Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] (PR#8791) crash with civ1 ruleset
Home

[Freeciv-Dev] (PR#8791) crash with civ1 ruleset

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#8791) crash with civ1 ruleset
From: "Gregory Berkolaiko" <Gregory.Berkolaiko@xxxxxxxxxxxxx>
Date: Fri, 21 May 2004 15:54:31 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8791 >

> [jdorje - Fri May 21 06:58:58 2004]:
>
> In civ1 there seem to be numerous units with a defense of 0.
> 
> A defense of 0 should be allowed!  So long as a unit with an attack of 0 
> is never allowed to attack this unit.

It's just a stupid bug, fix attached.

G.

Index: ai/advmilitary.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/advmilitary.c,v
retrieving revision 1.165
diff -u -r1.165 advmilitary.c
--- ai/advmilitary.c    2 May 2004 12:31:05 -0000       1.165
+++ ai/advmilitary.c    21 May 2004 22:53:06 -0000
@@ -763,6 +763,11 @@
     int move_type = unit_types[unit_type].move_type;
     int tech_dist;
     
+    if (unit_types[unit_type].attack_strength <= 0) {
+      /* You make me laugh!  We are looking for an attacker!! */
+      continue;
+    }
+
     if (tech_req != A_LAST) {
       tech_dist = num_unknown_techs_for_goal(pplayer, tech_req);
     } else {

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