From b8a237ac0d5063ce43b462af22da92e8c817f4d3 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Wed, 8 Mar 2006 03:19:13 +0000 Subject: Moved a variable definition into the right place and made getCurrentMap inline. --- src/engine.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/engine.cpp') diff --git a/src/engine.cpp b/src/engine.cpp index 2de3c282..6aff0dc9 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -123,11 +123,6 @@ Engine::~Engine() delete itemDb; } -Map *Engine::getCurrentMap() -{ - return mCurrentMap; -} - void Engine::changeMap(std::string mapPath) { // Clean up floor items @@ -149,9 +144,6 @@ void Engine::changeMap(std::string mapPath) logger->error("Could not find map file"); } - // Start playing new music file when necessary - std::string oldMusic = ""; - // Notify the minimap and beingManager about the map change Image *mapImage = NULL; if (newMap->hasProperty("minimap")) { @@ -161,6 +153,9 @@ void Engine::changeMap(std::string mapPath) minimap->setMapImage(mapImage); beingManager->setMap(newMap); + // Start playing new music file when necessary + std::string oldMusic = ""; + if (mCurrentMap) { oldMusic = mCurrentMap->getProperty("music"); delete mCurrentMap; -- cgit v1.2.3-70-g09d2