diff options
-rw-r--r-- | src/engine.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index a938aace..e8f9503c 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -97,11 +97,6 @@ bool Engine::changeMap(const std::string &mapPath) particleEngine->setMap(newMap); viewport->setMap(newMap); - delete mCurrentMap; - mCurrentMap = newMap; - - Net::getGameHandler()->mapLoaded(mapPath); - // Initialize map-based particle effects if (newMap) newMap->initializeParticleEffects(particleEngine); @@ -112,6 +107,11 @@ bool Engine::changeMap(const std::string &mapPath) if (newMusic != oldMusic) sound.playMusic(newMusic); + delete mCurrentMap; + mCurrentMap = newMap; + + Net::getGameHandler()->mapLoaded(mapPath); + return true; } |