Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2002:
[Freeciv-Dev] bugfix for can_unit_attack_tile()
Home

[Freeciv-Dev] bugfix for can_unit_attack_tile()

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] bugfix for can_unit_attack_tile()
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 13 Aug 2002 15:05:35 +0000 (GMT)

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.178
diff -u -r1.178 unittools.c
--- server/unittools.c  2002/06/01 19:25:26     1.178
+++ server/unittools.c  2002/08/13 15:01:42
@@ -160,6 +160,10 @@
 {
   struct unit *pdefender;
   pdefender=get_defender(punit, dest_x, dest_y);
+  if (!pfedender) {
+    /* nothing to attack */
+    return FALSE;
+  }
   return(can_unit_attack_unit_at_tile(punit, pdefender, dest_x, dest_y));
 }

Since calling can_unit_attack_unit_at_tile() with NULL as second parameter
gives us a core.

Yours
Per



[Prev in Thread] Current Thread [Next in Thread]