Trying to find the modulo problem

This commit is contained in:
2023-04-05 21:44:55 -07:00
parent 411076c903
commit 0e6befb92e
3 changed files with 9 additions and 4 deletions

View File

@ -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;
}