From e480e31d1ebcc02771eea694098477511069893f Mon Sep 17 00:00:00 2001 From: mrcheko Date: Fri, 20 Dec 2013 22:37:18 +0200 Subject: [PATCH] Revert "improvement to bug fix http://bugs.openmw.org/issues/428" This reverts commit c0d07fbdc9023b76853e2a0b20d9649e9eca1f0a. --- apps/openmw/mwinput/inputmanagerimp.cpp | 45 ++++++++++++------------- apps/openmw/mwmechanics/character.cpp | 19 +++++------ 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/apps/openmw/mwinput/inputmanagerimp.cpp b/apps/openmw/mwinput/inputmanagerimp.cpp index efa326a98..9b7fe98bd 100644 --- a/apps/openmw/mwinput/inputmanagerimp.cpp +++ b/apps/openmw/mwinput/inputmanagerimp.cpp @@ -180,9 +180,7 @@ namespace MWInput switch (action) { case A_GameMenu: - if(!(MWWorld::Class::get(mPlayer->getPlayer()).getCreatureStats(mPlayer->getPlayer()).isDead() - && MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_MainMenu ) ) - toggleMainMenu (); + toggleMainMenu (); break; case A_Screenshot: screenshot(); @@ -302,9 +300,7 @@ namespace MWInput return; // Disable movement in Gui mode - if (MWBase::Environment::get().getWindowManager()->isGuiMode() - || MWWorld::Class::get(mPlayer->getPlayer()).getCreatureStats(mPlayer->getPlayer()).isDead() ) - return; + if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return; // Configure player movement according to keyboard input. Actual movement will @@ -371,28 +367,29 @@ namespace MWInput } } - - if (mControlSwitch["playerviewswitch"]) { - // work around preview mode toggle when pressing Alt+Tab - if (actionIsActive(A_TogglePOV) && !mInputManager->isModifierHeld(SDL_Keymod(KMOD_ALT))) { + MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer(); + if ( !player.getClass().getCreatureStats(player).isDead() ) { + if (mControlSwitch["playerviewswitch"]) { + // work around preview mode toggle when pressing Alt+Tab + if (actionIsActive(A_TogglePOV) && !mInputManager->isModifierHeld(SDL_Keymod(KMOD_ALT))) { - if (mPreviewPOVDelay <= 0.5 && - (mPreviewPOVDelay += dt) > 0.5) - { - mPreviewPOVDelay = 1.f; - MWBase::Environment::get().getWorld()->togglePreviewMode(true); + if (mPreviewPOVDelay <= 0.5 && + (mPreviewPOVDelay += dt) > 0.5) + { + mPreviewPOVDelay = 1.f; + MWBase::Environment::get().getWorld()->togglePreviewMode(true); + } + } else { + if (mPreviewPOVDelay > 0.5) { + //disable preview mode + MWBase::Environment::get().getWorld()->togglePreviewMode(false); + } else if (mPreviewPOVDelay > 0.f) { + MWBase::Environment::get().getWorld()->togglePOV(); + } + mPreviewPOVDelay = 0.f; } - } else { - if (mPreviewPOVDelay > 0.5) { - //disable preview mode - MWBase::Environment::get().getWorld()->togglePreviewMode(false); - } else if (mPreviewPOVDelay > 0.f) { - MWBase::Environment::get().getWorld()->togglePOV(); - } - mPreviewPOVDelay = 0.f; } } - } if (actionIsActive(A_MoveForward) || actionIsActive(A_MoveBackward) || diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 1c4979e37..c8eba20d6 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1061,11 +1061,11 @@ bool CharacterController::kill() if( isDead() ) { //player death animation is over: toggle game menu without 'return' option - if( mPtr == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() - && !isAnimPlaying(mCurrentDeath) && MWBase::Environment::get().getWindowManager()->getMode () != MWGui::GM_MainMenu ) + if( mPtr == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() + && !isAnimPlaying(mCurrentDeath) ) { - MWWorld::Class::get(mPtr).getCreatureStats(mPtr).setHealth(0); - MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); + MWBase::Environment::get().getWindowManager()->setMainMenuNoReturn(true); + MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu); } return false; } @@ -1106,13 +1106,10 @@ bool CharacterController::kill() if(mAnimation) { - if (mPtr == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() ) - { - MWBase::Environment::get().getWindowManager()->setMainMenuNoReturn(true); - if (MWBase::Environment::get().getWorld()->getCamera()->isFirstPerson() ) - MWBase::Environment::get().getWorld()->togglePOV(); - } - + if (mPtr == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() + && MWBase::Environment::get().getWorld()->getCamera()->isFirstPerson() ) + MWBase::Environment::get().getWorld()->togglePOV(); + mAnimation->play(mCurrentDeath, Priority_Death, MWRender::Animation::Group_All, false, 1.0f, "start", "stop", 0.0f, 0); mAnimation->disable(mCurrentIdle);