summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
authorMatthias Hartmann <hartmann.matthias@gmail.com>2005-09-17 16:42:34 +0000
committerMatthias Hartmann <hartmann.matthias@gmail.com>2005-09-17 16:42:34 +0000
commitdb1f671668a615c5e1a4f48009708407bbac8d8c (patch)
treeb10ef65f484c27facc224bfc62c360e9caacaa7e /src/net
parent7d7ea134637eb06e194068f157d3eead90115631 (diff)
downloadmana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.gz
mana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.bz2
mana-db1f671668a615c5e1a4f48009708407bbac8d8c.tar.xz
mana-db1f671668a615c5e1a4f48009708407bbac8d8c.zip
Added PVP
Diffstat (limited to 'src/net')
-rw-r--r--src/net/protocol.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp
index 2e4089d4..318c446d 100644
--- a/src/net/protocol.cpp
+++ b/src/net/protocol.cpp
@@ -148,18 +148,22 @@ Being* attack(unsigned short x, unsigned short y, unsigned char direction)
{
case Being::SOUTH:
target = findNode(x, y + 1, Being::MONSTER);
+ if (!target) target = findNode(x, y + 1, Being::PLAYER);
break;
case Being::WEST:
target = findNode(x - 1, y, Being::MONSTER);
+ if (!target) target = findNode(x - 1, y, Being::PLAYER);
break;
case Being::NORTH:
target = findNode(x, y - 1, Being::MONSTER);
+ if (!target) target = findNode(x, y - 1, Being::PLAYER);
break;
case Being::EAST:
target = findNode(x + 1, y, Being::MONSTER);
+ if (!target) target = findNode(x + 1, y, Being::PLAYER);
break;
}