diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/protocol.cpp | 4 |
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; } |