mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 14:45:37 +00:00
Ensure forward-compatibility of death animations in old saves (fixes #4274)
This commit is contained in:
parent
b36bd75b59
commit
9abfabb065
1 changed files with 5 additions and 2 deletions
|
@ -662,16 +662,19 @@ MWWorld::ContainerStoreIterator getActiveWeapon(CreatureStats &stats, MWWorld::I
|
||||||
|
|
||||||
void CharacterController::playDeath(float startpoint, CharacterState death)
|
void CharacterController::playDeath(float startpoint, CharacterState death)
|
||||||
{
|
{
|
||||||
|
// Make sure the character was swimming upon death for forward-compatibility
|
||||||
|
const bool wasSwimming = MWBase::Environment::get().getWorld()->isSwimming(mPtr);
|
||||||
|
|
||||||
switch (death)
|
switch (death)
|
||||||
{
|
{
|
||||||
case CharState_SwimDeath:
|
case CharState_SwimDeath:
|
||||||
mCurrentDeath = "swimdeath";
|
mCurrentDeath = "swimdeath";
|
||||||
break;
|
break;
|
||||||
case CharState_SwimDeathKnockDown:
|
case CharState_SwimDeathKnockDown:
|
||||||
mCurrentDeath = "swimdeathknockdown";
|
mCurrentDeath = (wasSwimming ? "swimdeathknockdown" : "deathknockdown");
|
||||||
break;
|
break;
|
||||||
case CharState_SwimDeathKnockOut:
|
case CharState_SwimDeathKnockOut:
|
||||||
mCurrentDeath = "swimdeathknockout";
|
mCurrentDeath = (wasSwimming ? "swimdeathknockout" : "deathknockout");
|
||||||
break;
|
break;
|
||||||
case CharState_DeathKnockDown:
|
case CharState_DeathKnockDown:
|
||||||
mCurrentDeath = "deathknockdown";
|
mCurrentDeath = "deathknockdown";
|
||||||
|
|
Loading…
Reference in a new issue