From 8f786b2f02c225d41d397aaf7f826623eb1b7181 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 27 Jun 2005 00:33:19 +0000 Subject: 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. --- src/net/protocol.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/net') 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); } -- cgit v1.2.3-70-g09d2