Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2002:
[Freeciv-Dev] Re: Bomber goto doesn't find possible route (PR#1988)
Home

[Freeciv-Dev] Re: Bomber goto doesn't find possible route (PR#1988)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Bomber goto doesn't find possible route (PR#1988)
From: Jason Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Sep 2002 12:21:16 -0700 (PDT)

Gregory Berkolaiko wrote:
What a ridiculous bug!!

...

------------------------------------------------------------------------

Index: server/gotohand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/gotohand.c,v
retrieving revision 1.149
diff -u -r1.149 gotohand.c
--- server/gotohand.c   2002/08/25 13:34:58     1.149
+++ server/gotohand.c   2002/09/03 18:28:34
@@ -776,7 +776,7 @@
        /* Planes could run out of fuel, therefore we don't care if territory
           is unknown. Also, don't attack except at the destination. */

-        if (x1 != dest_x && y1 != dest_y) {
+        if (x1 != dest_x || y1 != dest_y) {
          /* If it's not our destination, we check if it's safe */
          if (!airspace_looks_safe(x1, y1, pplayer)) {
            continue;


Using same_pos() in places like this can increase readibility and reduce the chance of bugs. The current implementation makes it a bit slower (because of the function overhead), but that could be changed (i.e. macro/inlining).

jason




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