diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-27 00:33:19 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-06-27 00:33:19 +0000 |
commit | 8f786b2f02c225d41d397aaf7f826623eb1b7181 (patch) | |
tree | 3ac75c2d4267b301c7ba18ea848e8c699cab06b3 /src/net | |
parent | 6589b8f9ac0f57dc543b255d66b0d1b5a242b1e2 (diff) | |
download | mana-8f786b2f02c225d41d397aaf7f826623eb1b7181.tar.gz mana-8f786b2f02c225d41d397aaf7f826623eb1b7181.tar.bz2 mana-8f786b2f02c225d41d397aaf7f826623eb1b7181.tar.xz mana-8f786b2f02c225d41d397aaf7f826623eb1b7181.zip |
Fixed initialisation of Being*. The problem is that the attack() function is
since recently being called with up to 8 directions while it is written to only
handle 4.
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/protocol.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net/protocol.cpp b/src/net/protocol.cpp index f357b103..de41467e 100644 --- a/src/net/protocol.cpp +++ b/src/net/protocol.cpp @@ -226,7 +226,7 @@ void action(char type, int id) Being* attack(unsigned short x, unsigned short y, unsigned char direction) { - Being *target; + Being *target = NULL; if (direction == SOUTH) { target = findNode(x, y + 1); @@ -234,7 +234,7 @@ Being* attack(unsigned short x, unsigned short y, unsigned char direction) target = findNode(x - 1, y); } else if(direction == NORTH) { target = findNode(x, y - 1); - } else if(direction==EAST) { + } else if(direction == EAST) { target = findNode(x + 1, y); } |