forked from mirror/openmw-tes3mp
Refactor onChooseActionStatePerFrameActions
This prevents playIdle errors from tyring to play idleAnimation 0
This commit is contained in:
parent
f69de1f263
commit
5ea596f38d
1 changed files with 8 additions and 2 deletions
|
@ -392,18 +392,24 @@ namespace MWMechanics
|
||||||
short unsigned& idleAnimation = storage.mIdleAnimation;
|
short unsigned& idleAnimation = storage.mIdleAnimation;
|
||||||
idleAnimation = getRandomIdle();
|
idleAnimation = getRandomIdle();
|
||||||
|
|
||||||
|
//If we should be moving
|
||||||
if (!idleAnimation && mDistance)
|
if (!idleAnimation && mDistance)
|
||||||
{
|
{
|
||||||
storage.mState = Wander_MoveNow;
|
storage.mState = Wander_MoveNow;
|
||||||
}
|
}
|
||||||
else
|
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();
|
MWWorld::TimeStamp currentTime = MWBase::Environment::get().getWorld()->getTimeStamp();
|
||||||
mStartTime = currentTime;
|
mStartTime = currentTime;
|
||||||
playIdle(actor, idleAnimation);
|
|
||||||
storage.mState = Wander_IdleNow;
|
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)
|
void AiWander::evadeObstacles(const MWWorld::Ptr& actor, AiWanderStorage& storage, float duration)
|
||||||
|
|
Loading…
Reference in a new issue