mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 08:15:33 +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";
|
idle = "idleswim";
|
||||||
else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak"))
|
else if(mIdleState == CharState_IdleSneak && mAnimation->hasAnimation("idlesneak"))
|
||||||
idle = "idlesneak";
|
idle = "idlesneak";
|
||||||
else
|
else if(mIdleState != CharState_None)
|
||||||
{
|
{
|
||||||
idle = "idle";
|
idle = "idle";
|
||||||
if(weap != sWeaponTypeListEnd)
|
if(weap != sWeaponTypeListEnd)
|
||||||
|
@ -165,6 +165,7 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
||||||
|
|
||||||
mAnimation->disable(mCurrentIdle);
|
mAnimation->disable(mCurrentIdle);
|
||||||
mCurrentIdle = idle;
|
mCurrentIdle = idle;
|
||||||
|
if(!mCurrentIdle.empty())
|
||||||
mAnimation->play(mCurrentIdle, Priority_Default, MWRender::Animation::Group_All, false,
|
mAnimation->play(mCurrentIdle, Priority_Default, MWRender::Animation::Group_All, false,
|
||||||
1.0f, "start", "stop", 0.0f, ~0ul);
|
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)
|
CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Animation *anim)
|
||||||
: mPtr(ptr)
|
: mPtr(ptr)
|
||||||
, mAnimation(anim)
|
, mAnimation(anim)
|
||||||
, mIdleState(CharState_Idle)
|
, mIdleState(CharState_None)
|
||||||
, mMovementState(CharState_None)
|
, mMovementState(CharState_None)
|
||||||
, mMovementSpeed(0.0f)
|
, mMovementSpeed(0.0f)
|
||||||
, mDeathState(CharState_None)
|
, mDeathState(CharState_None)
|
||||||
|
@ -248,7 +249,9 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
||||||
* handle knockout and death which moves the character down. */
|
* handle knockout and death which moves the character down. */
|
||||||
mAnimation->setAccumulation(Ogre::Vector3(1.0f, 1.0f, 0.0f));
|
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. */
|
/* FIXME: Get the actual death state used. */
|
||||||
mDeathState = CharState_Death1;
|
mDeathState = CharState_Death1;
|
||||||
|
@ -258,6 +261,8 @@ CharacterController::CharacterController(const MWWorld::Ptr &ptr, MWRender::Anim
|
||||||
{
|
{
|
||||||
/* Don't accumulate with non-actors. */
|
/* Don't accumulate with non-actors. */
|
||||||
mAnimation->setAccumulation(Ogre::Vector3(0.0f));
|
mAnimation->setAccumulation(Ogre::Vector3(0.0f));
|
||||||
|
|
||||||
|
mIdleState = CharState_Idle;
|
||||||
}
|
}
|
||||||
|
|
||||||
refreshCurrentAnims(mIdleState, mMovementState, true);
|
refreshCurrentAnims(mIdleState, mMovementState, true);
|
||||||
|
|
Loading…
Reference in a new issue