Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11589) Missing TILE_XY uses
Home

[Freeciv-Dev] Re: (PR#11589) Missing TILE_XY uses

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#11589) Missing TILE_XY uses
From: "Benedict Adamson" <badamson@xxxxxxxxxxx>
Date: Sat, 18 Dec 2004 07:09:23 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11589 >

Here is a patch. This is applicable to the CVS development version of 
2004-12-28.

diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/advmilitary.c freeciv.PR11589/ai/advmilitary.c
--- vendor.freeciv.current/ai/advmilitary.c     2004-12-12 01:35:05.000000000 
+0000
+++ freeciv.PR11589/ai/advmilitary.c    2004-12-18 15:10:53.000000000 +0000
@@ -925,7 +925,7 @@
           CITY_LOG(LOG_DEBUG, pcity, "wants %s to build %s to punish 
%s@(%d,%d)"
                    " with desire %d", get_tech_name(pplayer, tech_req), 
                    unit_name(unit_type), (acity ? acity->name : "enemy"),
-                   ptile, want);
+                   TILE_XY(ptile), want);
 
         } else if (want > best_choice->want) {
           if (can_build_unit(pcity, unit_type)) {
diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/aidiplomat.c freeciv.PR11589/ai/aidiplomat.c
--- vendor.freeciv.current/ai/aidiplomat.c      2004-12-12 01:35:05.000000000 
+0000
+++ freeciv.PR11589/ai/aidiplomat.c     2004-12-18 15:10:53.000000000 +0000
@@ -517,7 +517,7 @@
     } else {
       /* usually because we ended move early due to another unit */
       UNIT_LOG(LOG_DIPLOMAT, punit, "could not bribe target (%d, %d), "
-               " %d moves left", pos.tile, punit->moves_left);
+               " %d moves left", TILE_XY(pos.tile), punit->moves_left);
       return FALSE;
     }
   } pf_iterator_end;
diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/aiferry.c freeciv.PR11589/ai/aiferry.c
--- vendor.freeciv.current/ai/aiferry.c 2004-12-07 21:30:51.000000000 +0000
+++ freeciv.PR11589/ai/aiferry.c        2004-12-18 15:10:52.000000000 +0000
@@ -409,7 +409,7 @@
     struct unit *ferryboat = NULL;
 
     UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, "will have to go to (%d,%d) by boat",
-             dest_tile);
+             TILE_XY(dest_tile));
 
     if (!is_ocean_near_tile(punit->tile)) {
       struct pf_path *path_to_ferry = NULL;
@@ -423,7 +423,7 @@
 
       ferryboat = find_unit_by_id(boatid);
       UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, "found boat[%d](%d,%d), going there", 
-              boatid, ferryboat->tile);
+              boatid, TILE_XY(ferryboat->tile));
       /* The path can be amphibious so we will stop at the coast.  
        * It might not lead _onto_ the boat. */
       if (!ai_unit_execute_path(punit, path_to_ferry)) { 
@@ -450,7 +450,7 @@
     /* Ok, a boat found, try boarding it */
     ferryboat = find_unit_by_id(boatid);
     UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, "found a nearby boat[%d](%d,%d)",
-            ferryboat->id, ferryboat->tile);
+            ferryboat->id, TILE_XY(ferryboat->tile));
     /* Setting ferry now in hope it won't run away even 
      * if we can't board it right now */
     aiferry_psngr_meet_boat(punit, ferryboat);
@@ -464,7 +464,7 @@
       /* FIXME: this is probably a serious bug, but we just skip past
        * it and continue. */
       UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, "couldn't board boat[%d](%d,%d)",
-              ferryboat->id, ferryboat->tile);
+              ferryboat->id, TILE_XY(ferryboat->tile));
       return FALSE;
     }
 
@@ -483,7 +483,7 @@
 
       UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, 
               "got boat[%d](moves left: %d), going (%d,%d)",
-               ferryboat->id, ferryboat->moves_left, dest_tile);
+               ferryboat->id, ferryboat->moves_left, TILE_XY(dest_tile));
       aiferry_psngr_meet_boat(punit, ferryboat);
 
       /* If the location is not accessible directly from sea
@@ -498,7 +498,7 @@
           return FALSE;
         }
         UNIT_LOG(LOGLEVEL_GOBYBOAT, punit, 
-                 "Found beachhead (%d,%d)", beach_tile);
+                 "Found beachhead (%d,%d)", TILE_XY(beach_tile));
       } else {
        beach_tile = dest_tile;
       }
@@ -595,7 +595,7 @@
              || aunit->ai.ferryboat == pferry->id)) {
         UNIT_LOG(LOGLEVEL_FERRY, pferry, 
                  "Found a potential cargo %s[%d](%d,%d), going there",
-                 unit_type(aunit)->name, aunit->id, aunit->tile);
+                 unit_type(aunit)->name, aunit->id, TILE_XY(aunit->tile));
        pferry->goto_tile = aunit->tile;
         /* Exchange phone numbers */
         aiferry_psngr_meet_boat(aunit, pferry);
@@ -668,7 +668,7 @@
                                       pcity->is_building_unit, TRUE);
 
       UNIT_LOG(LOGLEVEL_FERRY, pferry, "%s (%d, %d) looks promising...", 
-               pcity->name, pcity->tile);
+               pcity->name, TILE_XY(pcity->tile));
 
       if (pos.turn > turns && pcity->is_building_unit
           && unit_has_role(pcity->currently_building, L_FERRYBOAT)) {
diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/aihunt.c freeciv.PR11589/ai/aihunt.c
--- vendor.freeciv.current/ai/aihunt.c  2004-12-05 13:32:21.000000000 +0000
+++ freeciv.PR11589/ai/aihunt.c 2004-12-18 15:10:53.000000000 +0000
@@ -293,7 +293,8 @@
         dist1 = dist2 = 0;
       }
       UNIT_LOG(LOGLEVEL_HUNT, punit, "considering chasing %s(%d, %d) id %d "
-               "dist1 %d dist2 %d", unit_type(target)->name, target->tile,
+               "dist1 %d dist2 %d",
+              unit_type(target)->name, TILE_XY(target->tile),
                target->id, dist1, dist2);
       /* We can't attack units stationary in cities. */
       if (map_get_city(target->tile) 
@@ -393,7 +394,7 @@
           if (victim == target) {
             sucker = victim;
             UNIT_LOG(LOGLEVEL_HUNT, missile, "found primary target %d(%d, %d)"
-                     " dist %d", victim->id, victim->tile, 
+                     " dist %d", victim->id, TILE_XY(victim->tile), 
                      pos.total_MC);
             break; /* Our target! Get him!!! */
           }
@@ -404,7 +405,7 @@
             /* Threat to our carrier. Kill it. */
             sucker = victim;
             UNIT_LOG(LOGLEVEL_HUNT, missile, "found aux target %d(%d, %d)",
-                     victim->id, victim->tile);
+                     victim->id, TILE_XY(victim->tile));
             break;
           }
         } unit_list_iterate_end;
@@ -455,7 +456,7 @@
     return FALSE;
   }
   UNIT_LOG(LOGLEVEL_HUNT, punit, "hunting %d(%d, %d)",
-          target->id, target->tile);
+          target->id, TILE_XY(target->tile));
   sanity_target = target->id;
 
   /* Check if we can nuke it */
diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/aitools.c freeciv.PR11589/ai/aitools.c
--- vendor.freeciv.current/ai/aitools.c 2004-12-05 13:32:21.000000000 +0000
+++ freeciv.PR11589/ai/aitools.c        2004-12-18 15:10:52.000000000 +0000
@@ -194,7 +194,7 @@
     if (danger >= my_def) {
       UNIT_LOG(LOGLEVEL_BODYGUARD, punit, 
                "want bodyguard @(%d, %d) danger=%d, my_def=%d", 
-               dest_tile, danger, my_def);
+               TILE_XY(dest_tile), danger, my_def);
       punit->ai.bodyguard = BODYGUARD_WANTED;
     } else {
       punit->ai.bodyguard = BODYGUARD_NONE;
diff -ru -Xvendor.freeciv.current/diff_ignore 
vendor.freeciv.current/ai/aiunit.c freeciv.PR11589/ai/aiunit.c
--- vendor.freeciv.current/ai/aiunit.c  2004-12-05 13:32:21.000000000 +0000
+++ freeciv.PR11589/ai/aiunit.c 2004-12-18 15:10:53.000000000 +0000
@@ -629,7 +629,7 @@
 
         /* No need to amortize, our operation takes one turn. */
        UNIT_LOG(LOG_DEBUG, punit, "Rampage: Desire %d to kill %s(%d,%d)",
-                desire, unit_name(pdef->type), pdef->tile);
+                desire, unit_name(pdef->type), TILE_XY(pdef->tile));
 
         return MAX(0, desire);
       }
@@ -1167,7 +1167,7 @@
 
   if (pcity) {
     UNIT_LOG(LOG_DEBUG, punit, "go home to %s(%d,%d)",
-             pcity->name, pcity->tile); 
+             pcity->name, TILE_XY(pcity->tile)); 
     if (same_pos(punit->tile, pcity->tile)) {
       UNIT_LOG(LOG_DEBUG, punit, "go home successful; role AI_NONE");
       ai_unit_new_role(punit, AIUNIT_NONE, NULL);
@@ -1599,7 +1599,7 @@
         UNIT_LOG(LOG_DEBUG, punit, "in fstk with boat %s@(%d, %d) -> %s@(%d, 
%d)"
                  " (go_by_boat=%d, move_time=%d, want=%d, best=%d)",
                  unit_type(ferryboat)->name, best_tile->x, best_tile->y,
-                 acity->name, acity->tile, 
+                 acity->name, TILE_XY(acity->tile), 
                  go_by_boat, move_time, want, best);
       }
       

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