1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-06 15:45:32 +00:00

Refactor onChooseActionStatePerFrameActions

This prevents playIdle errors from tyring to play idleAnimation 0
This commit is contained in:
Arthur Moore 2015-07-30 08:15:45 -04:00
parent f69de1f263
commit 5ea596f38d

View file

@ -392,18 +392,24 @@ namespace MWMechanics
short unsigned& idleAnimation = storage.mIdleAnimation;
idleAnimation = getRandomIdle();
//If we should be moving
if (!idleAnimation && mDistance)
{
storage.mState = Wander_MoveNow;
}
else
{
// Play idle animation and recreate vanilla (broken?) behavior of resetting start time of AIWander:
//Recreate vanilla (broken?) behavior of resetting start time of AIWander:
MWWorld::TimeStamp currentTime = MWBase::Environment::get().getWorld()->getTimeStamp();
mStartTime = currentTime;
playIdle(actor, idleAnimation);
storage.mState = Wander_IdleNow;
}
//If we aren't going to just stand
if(idleAnimation)
{
playIdle(actor, idleAnimation);
}
}
void AiWander::evadeObstacles(const MWWorld::Ptr& actor, AiWanderStorage& storage, float duration)