Fixed weird fmod bug I guess

This commit is contained in:
2023-04-05 22:13:24 -07:00
parent 0e6befb92e
commit 599e354b90
9 changed files with 16 additions and 12 deletions

View File

@ -50,8 +50,8 @@ void EntityAIWalk::updateWander(float_t delta) {
wanderTimeToNextDecision = randRange(wanderTimeRandomRange.x, wanderTimeRandomRange.y);
// Do we want to move?
float_t rr = randRange(0.0f, 3.0f);
if(rr < wanderDoNotMoveChance) {
float_t n = randRange(0.0f, 1.0f);
if(n < wanderDoNotMoveChance) {
wanderDestination = physics3Dto2D(transform->getLocalPosition());
return;
}
@ -81,9 +81,10 @@ void EntityAIWalk::updateWander(float_t delta) {
// Stop moving if we're close enough
if(glm::length(diff) < 0.1f) {
wanderTimeToNextDecision = 0;
entityMove->direction = glm::vec2(0, 0);
} else {
entityMove->direction = diff;
}
entityMove->direction = diff;
}
void EntityAIWalk::updateFollowTarget(float_t delta) {