diff options
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 2cb48ba0..a938aace 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -97,6 +97,11 @@ 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); @@ -107,10 +112,6 @@ bool Engine::changeMap(const std::string &mapPath) if (newMusic != oldMusic) sound.playMusic(newMusic); - delete mCurrentMap; - mCurrentMap = newMap; - - Net::getGameHandler()->mapLoaded(mapPath); return true; } |