diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-25 23:04:58 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-25 23:04:58 +0200 |
commit | a36909f5c3408153c9b5f9477adde9b27d8c7482 (patch) | |
tree | 0acd7721cd2bb2b27878d20027d0510458581515 /src/map.cpp | |
parent | 4e18e7619e9a8c909dea3374a2a7aa39befe0c16 (diff) | |
download | mana-a36909f5c3408153c9b5f9477adde9b27d8c7482.tar.gz mana-a36909f5c3408153c9b5f9477adde9b27d8c7482.tar.bz2 mana-a36909f5c3408153c9b5f9477adde9b27d8c7482.tar.xz mana-a36909f5c3408153c9b5f9477adde9b27d8c7482.zip |
Handle map not found gracefully
Instead of shutting down, the client will now draw a gray background.
This allows the player to still contact a GM in order to be helped out
of the situation.
It also helps me warp out of the non-existing map I accidentally warped
myself onto. ;)
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp index 4d867865..f0a5eae0 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -460,6 +460,19 @@ void Map::removeSprite(SpriteIterator iterator) mSprites.erase(iterator); } +const std::string &Map::getMusicFile() const +{ + return getProperty("music"); +} + +const std::string &Map::getName() const +{ + if (hasProperty("name")) + return getProperty("name"); + + return getProperty("mapname"); +} + static int const basicCost = 100; Path Map::findPath(int startX, int startY, int destX, int destY, unsigned char walkmask, int maxCost) |