summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 03:19:13 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2006-03-08 03:19:13 +0000
commitb8a237ac0d5063ce43b462af22da92e8c817f4d3 (patch)
tree13c43076a30ac6aee72a7a1326e4ae77bee9072a
parentd9db81d03e979028c5e0b9eac1ae951499b776a3 (diff)
downloadmana-client-b8a237ac0d5063ce43b462af22da92e8c817f4d3.tar.gz
mana-client-b8a237ac0d5063ce43b462af22da92e8c817f4d3.tar.bz2
mana-client-b8a237ac0d5063ce43b462af22da92e8c817f4d3.tar.xz
mana-client-b8a237ac0d5063ce43b462af22da92e8c817f4d3.zip
Moved a variable definition into the right place and made getCurrentMap inline.
-rw-r--r--ChangeLog2
-rw-r--r--src/engine.cpp11
-rw-r--r--src/engine.h2
3 files changed, 6 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 44c3dc39..a0102dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2006-03-08 Björn Steinbrink <B.Steinbrink@gmx.de>
+ * src/engine.cpp, src/engine.h: Moved a variable definition into the
+ right place and made getCurrentMap inline.
* src/equipment.cpp, src/equipment.h: Use STL algorithms and make
destructor inline.
* src/localplayer.cpp, src/gui/gui.cpp: Let the LocalPlayer decide
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;
diff --git a/src/engine.h b/src/engine.h
index 87cf1900..fd508857 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -51,7 +51,7 @@ class Engine
/**
* Returns the currently active map.
*/
- Map *getCurrentMap();
+ Map *getCurrentMap() { return mCurrentMap; }
/**
* Sets the currently active map.