diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/game-server/mapmanager.cpp | 3 | ||||
-rw-r--r-- | src/game-server/mapmanager.hpp | 8 |
3 files changed, 9 insertions, 5 deletions
@@ -5,6 +5,9 @@ src/utils/encryption.cpp, src/account-server/accounthandler.cpp, src/Makefile.am: Switched to alternative SHA-256 implementation from InspIRCd. + * src/game-server/mapmanager.cpp, src/game-server/mapmanager.hpp: + Accepted fix by rodge, getting rid of assertion failure when an admin + tries to warp to a non-existing map. 2008-04-22 Bjørn Lindeijer <bjorn@lindeijer.nl> 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 |