diff --git a/CHANGELOG.md b/CHANGELOG.md index b1f00cccd..0643b220d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped Bug #2455: Creatures attacks degrade armor Bug #2562: Forcing AI to activate a teleport door sometimes causes a crash + Bug #2626: Resurrecting the player does not resume the game Bug #2772: Non-existing class or faction freezes the game Bug #2835: Player able to slowly move when overencumbered Bug #2852: No murder bounty when a player follower commits murder diff --git a/apps/openmw/mwbase/statemanager.hpp b/apps/openmw/mwbase/statemanager.hpp index 48a95f029..643695c37 100644 --- a/apps/openmw/mwbase/statemanager.hpp +++ b/apps/openmw/mwbase/statemanager.hpp @@ -55,6 +55,8 @@ namespace MWBase virtual void endGame() = 0; + virtual void resumeGame() = 0; + virtual void deleteGame (const MWState::Character *character, const MWState::Slot *slot) = 0; virtual void saveGame (const std::string& description, const MWState::Slot *slot = 0) = 0; diff --git a/apps/openmw/mwscript/statsextensions.cpp b/apps/openmw/mwscript/statsextensions.cpp index 70910ec2f..fadc99b66 100644 --- a/apps/openmw/mwscript/statsextensions.cpp +++ b/apps/openmw/mwscript/statsextensions.cpp @@ -17,6 +17,7 @@ #include "../mwbase/environment.hpp" #include "../mwbase/dialoguemanager.hpp" #include "../mwbase/mechanicsmanager.hpp" +#include "../mwbase/statemanager.hpp" #include "../mwbase/windowmanager.hpp" #include "../mwbase/world.hpp" @@ -1139,7 +1140,11 @@ namespace MWScript MWWorld::Ptr ptr = R()(runtime); if (ptr == MWMechanics::getPlayer()) + { ptr.getClass().getCreatureStats(ptr).resurrect(); + if (MWBase::Environment::get().getStateManager()->getState() == MWBase::StateManager::State_Ended) + MWBase::Environment::get().getStateManager()->resumeGame(); + } else if (ptr.getClass().getCreatureStats(ptr).isDead()) { bool wasEnabled = ptr.getRefData().isEnabled(); diff --git a/apps/openmw/mwstate/statemanagerimp.cpp b/apps/openmw/mwstate/statemanagerimp.cpp index c1bb589e8..234925839 100644 --- a/apps/openmw/mwstate/statemanagerimp.cpp +++ b/apps/openmw/mwstate/statemanagerimp.cpp @@ -173,6 +173,11 @@ void MWState::StateManager::endGame() mState = State_Ended; } +void MWState::StateManager::resumeGame() +{ + mState = State_Running; +} + void MWState::StateManager::saveGame (const std::string& description, const Slot *slot) { MWState::Character* character = getCurrentCharacter(); diff --git a/apps/openmw/mwstate/statemanagerimp.hpp b/apps/openmw/mwstate/statemanagerimp.hpp index 5defcdea3..d71fae850 100644 --- a/apps/openmw/mwstate/statemanagerimp.hpp +++ b/apps/openmw/mwstate/statemanagerimp.hpp @@ -48,6 +48,8 @@ namespace MWState virtual void endGame(); + virtual void resumeGame(); + virtual void deleteGame (const MWState::Character *character, const MWState::Slot *slot); ///< Delete a saved game slot from this character. If all save slots are deleted, the character will be deleted too.