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:
parent
f69de1f263
commit
5ea596f38d
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue