Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] (PR#2633) ai_military_attack() bug#1
Home

[Freeciv-Dev] (PR#2633) ai_military_attack() bug#1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients:;
Subject: [Freeciv-Dev] (PR#2633) ai_military_attack() bug#1
From: "Per I. Mathisen via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 23 Dec 2002 06:17:39 -0800
Reply-to: rt@xxxxxxxxxxxxxx

@@ -1980,7 +2012,7 @@
       repeat++;
       if (!is_tiles_adjacent(punit->x, punit->y, dest_x, dest_y)
           || !can_unit_attack_tile(punit, dest_x, dest_y)
-          || could_unit_move_to_tile(punit, dest_x, dest_y) == 0) {
+          || !could_unit_move_to_tile(punit, dest_x, dest_y) == 0) {
         /* Can't attack or move usually means we are adjacent but
          * on a ferry. This fixes the problem (usually). */
         int i = ai_military_gothere(pplayer, punit, dest_x, dest_y);

We should only use ai_military_gothere() if we can't single-step into the
tile. The comment is correct (but maybe a little misleading - the biggest
reason to use gothere is when you are _not_ adjacent), while the code is
wrong.

This should be fixed for both head and S1_14.

  - Per




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#2633) ai_military_attack() bug#1, Per I. Mathisen via RT <=