Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] (PR#8670) Bug: old veteran system still in use
Home

[Freeciv-Dev] (PR#8670) Bug: old veteran system still in use

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#8670) Bug: old veteran system still in use
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 20 Jul 2004 04:21:51 -0700
Reply-to: rt@xxxxxxxxxxx

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

Correct patch.

  - Per
Index: ai/aitools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/aitools.c,v
retrieving revision 1.114
diff -u -r1.114 aitools.c
--- ai/aitools.c        7 Jul 2004 07:32:03 -0000       1.114
+++ ai/aitools.c        20 Jul 2004 11:20:55 -0000
@@ -180,11 +180,11 @@
   ptile = map_get_tile(punit->x, punit->y);
   /* We look for the bodyguard where we stand. */
   if (!unit_list_find(&ptile->units, punit->ai.bodyguard)) {
-    /* FIXME: use veteran system to calculate defense. */
-    int my_def = (punit->hp * (punit->veteran != 0 ? 15 : 10)
-                 * unit_type(punit)->defense_strength);
+    int my_def = (punit->hp 
+                  * unit_type(punit)->veteran[punit->veteran].power_fact
+                 * unit_type(punit)->defense_strength
+                  * POWER_FACTOR);
     
-    /* FIXME: danger is multiplied by POWER_FACTOR, my_def isn't. */
     if (danger >= my_def) {
       UNIT_LOG(LOGLEVEL_BODYGUARD, punit, 
                "want bodyguard @(%d, %d) danger=%d, my_def=%d", 

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