diff options
author | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-19 20:10:27 +0100 |
---|---|---|
committer | Philipp Sehmisch <crush@themanaworld.org> | 2009-03-19 20:10:27 +0100 |
commit | 3dec609dc5f343547fad87dbbd3d7c7e2c59dde5 (patch) | |
tree | e272c0d3ae0c56b9b455d81718b9a51e7439b101 /src/game-server/being.cpp | |
parent | 53cde41db10d69120cdc46f278178fc5667744a1 (diff) | |
download | manaserv-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/being.cpp')
-rw-r--r-- | src/game-server/being.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index cec2c4e6..ace30861 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -190,6 +190,11 @@ void Being::performAttack(Damage const &damage, AttackZone const *attackZone) int type = o->getType(); if (type != OBJECT_CHARACTER && type != OBJECT_MONSTER) continue; + if (getMap()->getPvP() == PVP_NONE && + type == OBJECT_CHARACTER && + getType() == OBJECT_CHARACTER) + continue; + LOG_DEBUG("Attack Zone:"<< attPos.x<<":"<<attPos.y<< " "<< |