summaryrefslogtreecommitdiff
path: root/src/game-server/map.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <crush@themanaworld.org>2009-03-19 20:10:27 +0100
committerPhilipp Sehmisch <crush@themanaworld.org>2009-03-19 20:10:27 +0100
commit3dec609dc5f343547fad87dbbd3d7c7e2c59dde5 (patch)
treee272c0d3ae0c56b9b455d81718b9a51e7439b101 /src/game-server/map.cpp
parent53cde41db10d69120cdc46f278178fc5667744a1 (diff)
downloadmanaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.gz
manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.bz2
manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.tar.xz
manaserv-3dec609dc5f343547fad87dbbd3d7c7e2c59dde5.zip
Implemented the possibility to have maps with or without PvP combat.
PvP is governed by the map property "pvp". Currently it can be either "none" for no PvP combat or "free" for unrestricted PvP combat. "none" is the default value which is used when pvp is undefined. Later addition of more sophisticated PvP modes is possible.
Diffstat (limited to 'src/game-server/map.cpp')
-rw-r--r--src/game-server/map.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game-server/map.cpp b/src/game-server/map.cpp
index 0956571e..f66f8876 100644
--- a/src/game-server/map.cpp
+++ b/src/game-server/map.cpp
@@ -81,6 +81,14 @@ Map::setSize(int width, int height)
}
}
+const std::string &Map::getProperty(const std::string &key) const
+{
+ std::map<std::string, std::string>::const_iterator i;
+ i = mProperties.find(key);
+ if (i == mProperties.end()) return "";
+ return i->second;
+}
+
void Map::blockTile(int x, int y, BlockType type)
{
if (type == BLOCKTYPE_NONE || x < 0 || y < 0 || x >= mWidth || y >= mHeight)