Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2006:
[Freeciv-Dev] (PR#18440) [Bug+Patch] Wrong warmap after generate_warmap(
Home

[Freeciv-Dev] (PR#18440) [Bug+Patch] Wrong warmap after generate_warmap(

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#18440) [Bug+Patch] Wrong warmap after generate_warmap()
From: "Marko Lindqvist" <cazfi74@xxxxxxxxx>
Date: Sun, 9 Jul 2006 13:02:09 -0700
Reply-to: bugs@xxxxxxxxxxx

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


  Calling really_generate_warmap() directly is not a good idea. It will 
mess with warmap contents but leaves warunit and warcity variables as 
they were. Next time generate_warmap() is called, it may decide that 
existing warmap is still useful based on warunit and warcity variables.



  - ML

diff -Nurd -X.diff_ignore freeciv/ai/aiunit.c freeciv/ai/aiunit.c
--- freeciv/ai/aiunit.c 2006-07-09 22:25:57.343750000 +0300
+++ freeciv/ai/aiunit.c 2006-07-09 22:58:24.734375000 +0300
@@ -1321,8 +1321,7 @@
 
   if (ferryboat) {
     boattype = ferryboat->type;
-    really_generate_warmap(tile_get_city(ferryboat->tile),
-                           ferryboat, SEA_MOVING);
+    generate_warmap(tile_get_city(ferryboat->tile), ferryboat);
   } else {
     boattype = best_role_unit_for_player(pplayer, L_FERRYBOAT);
     if (boattype == NULL) {
diff -Nurd -X.diff_ignore freeciv/server/gotohand.c freeciv/server/gotohand.c
--- freeciv/server/gotohand.c   2006-07-09 22:30:12.187500000 +0300
+++ freeciv/server/gotohand.c   2006-07-09 22:55:39.250000000 +0300
@@ -265,8 +265,8 @@
 This would be done by inserting the tiles in a list after their move_cost
 as they were found.
 **************************************************************************/
-void really_generate_warmap(struct city *pcity, struct unit *punit,
-                           enum unit_move_type move_type)
+static void really_generate_warmap(struct city *pcity, struct unit *punit,
+                                   enum unit_move_type move_type)
 {
   int move_cost;
   struct tile *orig_tile;
diff -Nurd -X.diff_ignore freeciv/server/gotohand.h freeciv/server/gotohand.h
--- freeciv/server/gotohand.h   2006-07-09 22:44:40.484375000 +0300
+++ freeciv/server/gotohand.h   2006-07-09 22:55:28.812500000 +0300
@@ -34,8 +34,6 @@
                              enum goto_move_restriction restriction,
                              bool trigger_special_ability);
 void generate_warmap(struct city *pcity, struct unit *punit);
-void really_generate_warmap(struct city *pcity, struct unit *punit,
-                           enum unit_move_type move_type);
 int calculate_move_cost(struct unit *punit, struct tile *dst_tile);
 int air_can_move_between(int moves, struct tile *src_tile,
                         struct tile *dst_tile, struct player *pplayer);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#18440) [Bug+Patch] Wrong warmap after generate_warmap(), Marko Lindqvist <=