Fix forced switch to third person on death not always working

For instance, when dying from fall damage
deque
scrawl 11 years ago
parent b6e52ae8ab
commit d2e98c4de1

@ -409,6 +409,13 @@ MWWorld::ContainerStoreIterator getActiveWeapon(CreatureStats &stats, MWWorld::I
void CharacterController::playDeath(float startpoint, CharacterState death) void CharacterController::playDeath(float startpoint, CharacterState death)
{ {
if (mPtr == MWBase::Environment::get().getWorld()->getPlayerPtr())
{
// The first-person animations do not include death, so we need to
// force-switch to third person before playing the death animation.
MWBase::Environment::get().getWorld()->useDeathCamera();
}
switch (death) switch (death)
{ {
case CharState_SwimDeath: case CharState_SwimDeath:

@ -140,11 +140,11 @@ namespace MWRender
} }
} }
void Camera::toggleViewMode() void Camera::toggleViewMode(bool force)
{ {
// Changing the view will stop all playing animations, so if we are playing // Changing the view will stop all playing animations, so if we are playing
// anything important, queue the view change for later // anything important, queue the view change for later
if (!mAnimation->allowSwitchViewMode()) if (!mAnimation->allowSwitchViewMode() && !force)
{ {
mViewModeToggleQueued = true; mViewModeToggleQueued = true;
return; return;

@ -75,7 +75,8 @@ namespace MWRender
/// Attach camera to object /// Attach camera to object
void attachTo(const MWWorld::Ptr &); void attachTo(const MWWorld::Ptr &);
void toggleViewMode(); /// @param Force view mode switch, even if currently not allowed by the animation.
void toggleViewMode(bool force=false);
bool toggleVanityMode(bool enable); bool toggleVanityMode(bool enable);
void allowVanityMode(bool allow); void allowVanityMode(bool allow);

@ -144,7 +144,6 @@ void MWState::StateManager::newGame (bool bypass)
void MWState::StateManager::endGame() void MWState::StateManager::endGame()
{ {
mState = State_Ended; mState = State_Ended;
MWBase::Environment::get().getWorld()->useDeathCamera();
} }
void MWState::StateManager::saveGame (const std::string& description, const Slot *slot) void MWState::StateManager::saveGame (const std::string& description, const Slot *slot)

@ -432,7 +432,7 @@ namespace MWWorld
mRendering->getCamera()->toggleVanityMode(false); mRendering->getCamera()->toggleVanityMode(false);
} }
if(mRendering->getCamera()->isFirstPerson()) if(mRendering->getCamera()->isFirstPerson())
togglePOV(); mRendering->getCamera()->toggleViewMode(true);
} }
MWWorld::Player& World::getPlayer() MWWorld::Player& World::getPlayer()

Loading…
Cancel
Save