summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:24:49 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-04-23 17:24:49 +0000
commiteca52c90e80f76c1fdffb5b1420a9cc4641de2fb (patch)
tree3e753b6506977b75a15eec35774452ff067af116 /src
parentcac2b7d1bd79e312e2009eca216ace2a29e60621 (diff)
downloadmanaserv-eca52c90e80f76c1fdffb5b1420a9cc4641de2fb.tar.gz
manaserv-eca52c90e80f76c1fdffb5b1420a9cc4641de2fb.tar.bz2
manaserv-eca52c90e80f76c1fdffb5b1420a9cc4641de2fb.tar.xz
manaserv-eca52c90e80f76c1fdffb5b1420a9cc4641de2fb.zip
Accepted fix by rodge, getting rid of assertion failure when an admin tries to
warp to a non-existing map.
Diffstat (limited to 'src')
-rw-r--r--src/game-server/mapmanager.cpp3
-rw-r--r--src/game-server/mapmanager.hpp8
2 files changed, 6 insertions, 5 deletions
diff --git a/src/game-server/mapmanager.cpp b/src/game-server/mapmanager.cpp
index de752c00..3044d350 100644
--- a/src/game-server/mapmanager.cpp
+++ b/src/game-server/mapmanager.cpp
@@ -102,8 +102,7 @@ void MapManager::deinitialize()
MapComposite *MapManager::getMap(int mapId)
{
Maps::iterator i = maps.find(mapId);
- assert(i != maps.end());
- return i->second;
+ return (i != maps.end()) ? i->second : NULL;
}
void MapManager::raiseActive(int mapId)
diff --git a/src/game-server/mapmanager.hpp b/src/game-server/mapmanager.hpp
index 432b0b1a..5abc51dc 100644
--- a/src/game-server/mapmanager.hpp
+++ b/src/game-server/mapmanager.hpp
@@ -36,7 +36,7 @@ namespace MapManager
/**
* Loads map reference file and prepares maps.
*/
- void initialize(std::string const &);
+ void initialize(std::string const &mapReferenceFile);
/**
* Destroy loaded maps.
@@ -45,8 +45,10 @@ namespace MapManager
/**
* Returns the requested map.
+ *
+ * @return the requested map, or NULL if no map with the given ID exists.
*/
- MapComposite *getMap(int);
+ MapComposite *getMap(int mapId);
/**
* Returns all the maps.
@@ -56,7 +58,7 @@ namespace MapManager
/**
* Sets the activity status of the map.
*/
- void raiseActive(int);
+ void raiseActive(int mapId);
}
#endif