mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 09:23:51 +00:00
Don't start with an idle state if dead
This commit is contained in:
parent
e78bdd2a5d
commit
f01b0b48cc
1 changed files with 10 additions and 5 deletions
|
@ -152,7 +152,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
idle = "idleswim";
|
||||
else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak"))
|
||||
idle = "idlesneak";
|
||||
else
|
||||
else if(mIdleState != CharState_None)
|
||||
{
|
||||
idle = "idle";
|
||||
if(weap != sWeaponTypeListEnd)
|
||||
|
@ -165,6 +165,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
|||
|
||||
mAnimation->disable(mCurrentIdle);
|
||||
mCurrentIdle = idle;
|
||||
if(!mCurrentIdle.empty())
|
||||
mAnimation->play(mCurrentIdle, Priority_Default, MWRender::Animation::Group_All, false,
|
||||
1.0f, "start", "stop", 0.0f, ~0ul);
|
||||
}
|
||||
|
@ -229,7 +230,7 @@ void CharacterController::getWeaponGroup(WeaponType weaptype, std::string &group
|
|||
CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim)
|
||||
: mPtr(ptr)
|
||||
, mAnimation(anim)
|
||||
, mIdleState(CharState_Idle)
|
||||
, mIdleState(CharState_None)
|
||||
, mMovementState(CharState_None)
|
||||
, mMovementSpeed(0.0f)
|
||||
, mDeathState(CharState_None)
|
||||
|
@ -248,7 +249,9 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
|||
* handle knockout and death which moves the character down. */
|
||||
mAnimation->setAccumulation(Ogre::Vector3(1.0f, 1.0f, 0.0f));
|
||||
|
||||
if(MWWorld::Class::get(mPtr).getCreatureStats(mPtr).isDead())
|
||||
if(!MWWorld::Class::get(mPtr).getCreatureStats(mPtr).isDead())
|
||||
mIdleState = CharState_Idle;
|
||||
else
|
||||
{
|
||||
/* FIXME: Get the actual death state used. */
|
||||
mDeathState = CharState_Death1;
|
||||
|
@ -258,6 +261,8 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
|||
{
|
||||
/* Don't accumulate with non-actors. */
|
||||
mAnimation->setAccumulation(Ogre::Vector3(0.0f));
|
||||
|
||||
mIdleState = CharState_Idle;
|
||||
}
|
||||
|
||||
refreshCurrentAnims(mIdleState, mMovementState, true);
|
||||
|
|
Loading…
Reference in a new issue