Fixed weird fmod bug I guess
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user