Trying to find the modulo problem
This commit is contained in:
@ -25,9 +25,11 @@ void EntityAIWalk::onStart() {
|
||||
case ENTITY_AI_WALK_MODE_FOLLOW_TARGET:
|
||||
this->updateFollowTarget(delta);
|
||||
break;
|
||||
|
||||
case ENTITY_AI_WALK_MODE_WANDER:
|
||||
this->updateWander(delta);
|
||||
break;
|
||||
|
||||
case ENTITY_AI_WALK_MODE_STAY:
|
||||
this->entityMove->direction = glm::vec2(0, 0);
|
||||
break;
|
||||
@ -48,8 +50,9 @@ void EntityAIWalk::updateWander(float_t delta) {
|
||||
wanderTimeToNextDecision = randRange(wanderTimeRandomRange.x, wanderTimeRandomRange.y);
|
||||
|
||||
// Do we want to move?
|
||||
if(randRange(0.0f, 1.0f) < wanderDoNotMoveChance) {
|
||||
this->entityMove->direction = glm::vec2(0, 0);
|
||||
float_t rr = randRange(0.0f, 3.0f);
|
||||
if(rr < wanderDoNotMoveChance) {
|
||||
wanderDestination = physics3Dto2D(transform->getLocalPosition());
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user