From 1dfe438a5d37401b75bd2de491a2524cc92ffd21 Mon Sep 17 00:00:00 2001 From: dteviot Date: Sun, 30 Aug 2015 16:43:35 +1200 Subject: [PATCH] reduce "reset if stuck" AiWander timeout. Now is about 14 seconds, instead of 300. --- apps/openmw/mwmechanics/aiwander.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index 67a9f766c..b789c4428 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -27,7 +27,7 @@ namespace MWMechanics { - static const int COUNT_BEFORE_RESET = 200; // TODO: maybe no longer needed + static const int COUNT_BEFORE_RESET = 10; static const float DOOR_CHECK_INTERVAL = 1.5f; static const float REACTION_INTERVAL = 0.25f; static const int GREETING_SHOULD_START = 4; //how many reaction intervals should pass before NPC can greet player @@ -443,8 +443,8 @@ namespace MWMechanics { movement.mPosition[1] = 1; } -//#if 0 - // TODO: maybe no longer needed + + // if stuck for sufficiently long, act like current location was the destination if (mStuckCount >= COUNT_BEFORE_RESET) // something has gone wrong, reset { //std::cout << "Reset \""<< cls.getName(actor) << "\"" << std::endl; @@ -454,7 +454,6 @@ namespace MWMechanics storage.mState = Wander_ChooseAction; mStuckCount = 0; } -//#endif } void AiWander::playIdleDialogueRandomly(const MWWorld::Ptr& actor)