summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 2edc6550..709fcec4 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -67,10 +67,15 @@ Engine::~Engine()
void Engine::changeMap(const std::string &mapPath)
{
- // Clean up floor items
+ // Clean up floor items, beings and particles
floorItemManager->clear();
-
beingManager->clear();
+
+ // Unset the map of the player so that its particles are cleared before
+ // being deleted in the next step
+ if (player_node)
+ player_node->setMap(0);
+
particleEngine->clear();
// Store full map path in global var