From 4faca4f638aabf9d86078c46e9d2c33ce7b63bf0 Mon Sep 17 00:00:00 2001 From: Jacob Jensen Date: Sun, 6 Jul 2014 02:03:20 +0200 Subject: [PATCH] Fixed save/load crash introduced with life-sustained systems change. --- src/engine/engine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index 175eeb451a8..6e1c019d4fd 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -144,6 +144,14 @@ struct Engine::Implementation : public Ogre::WindowEventListener { pair.second->entityManager().clear(); } } + for (auto& kv : *m_prevShutdownSystems) { + kv.first->deactivate(); + } + for (auto& kv : *m_nextShutdownSystems) { + kv.first->deactivate(); + } + m_prevShutdownSystems->clear(); + m_nextShutdownSystems->clear(); m_currentGameState = nullptr; // Switch gamestate std::string gameStateName = savegame.get("currentGameState");