Merge pull request #1793 from Capostrophic/death

Ensure forward-compatibility of death animations of pre-0.43.0 saves (bug #4274)
This commit is contained in:
Bret Curtis 2018-07-06 10:23:51 +02:00 committed by GitHub
commit 94ea9e7dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View file

@ -26,6 +26,7 @@
Bug #4215: OpenMW shows book text after last EOL tag Bug #4215: OpenMW shows book text after last EOL tag
Bug #4221: Characters get stuck in V-shaped terrain Bug #4221: Characters get stuck in V-shaped terrain
Bug #4251: Stationary NPCs do not return to their position after combat Bug #4251: Stationary NPCs do not return to their position after combat
Bug #4274: Pre-0.43 death animations are not forward-compatible with 0.43+
Bug #4286: Scripted animations can be interrupted Bug #4286: Scripted animations can be interrupted
Bug #4291: Non-persistent actors that started the game as dead do not play death animations Bug #4291: Non-persistent actors that started the game as dead do not play death animations
Bug #4293: Faction members are not aware of faction ownerships in barter Bug #4293: Faction members are not aware of faction ownerships in barter

View file

@ -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";