Ensure forward-compatibility of death animations in old saves (fixes #4274)

pull/457/head
Capostrophic 7 years ago committed by GitHub
parent b36bd75b59
commit 9abfabb065
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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…
Cancel
Save