Author: cazfi
Date: Mon May  8 15:35:43 2017
New Revision: 35461

URL: http://svn.gna.org/viewcvs/freeciv?rev=35461&view=rev
Log:
Make game_remove_city|unit() to take world parameter

See hrm Feature #658117

Modified:
    trunk/client/climisc.c
    trunk/common/game.c
    trunk/common/game.h
    trunk/common/player.c
    trunk/server/citytools.c
    trunk/server/unittools.c

Modified: trunk/client/climisc.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/climisc.c?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/client/climisc.c      (original)
+++ trunk/client/climisc.c      Mon May  8 15:35:43 2017
@@ -94,7 +94,7 @@
   }
 
   control_unit_killed(punit);
-  game_remove_unit(punit);
+  game_remove_unit(&wld, punit);
   punit = NULL;
   if (old > 0 && get_num_units_in_focus() == 0) {
     unit_focus_advance();
@@ -153,7 +153,7 @@
   }
 
   popdown_city_dialog(pcity);
-  game_remove_city(pcity);
+  game_remove_city(&wld, pcity);
   city_report_dialog_update();
   refresh_city_mapcanvas(&old_city, ptile, TRUE, FALSE);
 }

Modified: trunk/common/game.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/game.c?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/common/game.c (original)
+++ trunk/common/game.c Mon May  8 15:35:43 2017
@@ -138,7 +138,7 @@
 /**************************************************************************
   In the server call wipe_unit(), and never this function directly.
 **************************************************************************/
-void game_remove_unit(struct unit *punit)
+void game_remove_unit(struct world *gworld, struct unit *punit)
 {
   struct city *pcity;
 
@@ -181,7 +181,7 @@
   unit_list_remove(unit_tile(punit)->units, punit);
   unit_list_remove(unit_owner(punit)->units, punit);
 
-  idex_unregister_unit(&wld, punit);
+  idex_unregister_unit(gworld, punit);
 
   if (game.callbacks.unit_deallocate) {
     (game.callbacks.unit_deallocate)(punit->id);
@@ -192,7 +192,7 @@
 /**************************************************************************
   Remove city from game.
 **************************************************************************/
-void game_remove_city(struct city *pcity)
+void game_remove_city(struct world *gworld, struct city *pcity)
 {
   struct tile *pcenter = city_tile(pcity);
   struct player *powner = city_owner(pcity);
@@ -220,7 +220,7 @@
     } city_tile_iterate_end;
   }
 
-  idex_unregister_city(&wld, pcity);
+  idex_unregister_city(gworld, pcity);
   destroy_city_virtual(pcity);
 }
 

Modified: trunk/common/game.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/game.h?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/common/game.h (original)
+++ trunk/common/game.h Mon May  8 15:35:43 2017
@@ -305,8 +305,8 @@
 
 struct unit *game_unit_by_number(int id);
 
-void game_remove_unit(struct unit *punit);
-void game_remove_city(struct city *pcity);
+void game_remove_unit(struct world *gworld, struct unit *punit);
+void game_remove_city(struct world *gworld, struct city *pcity);
 void initialize_globals(void);
 
 bool is_player_phase(const struct player *pplayer, int phase);

Modified: trunk/common/player.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/common/player.c?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/common/player.c       (original)
+++ trunk/common/player.c       Mon May  8 15:35:43 2017
@@ -669,11 +669,11 @@
       punit->client.transported_by = -1;
     }
 
-    game_remove_unit(punit);
+    game_remove_unit(&wld, punit);
   } unit_list_iterate_end;
 
   city_list_iterate(pplayer->cities, pcity) {
-    game_remove_city(pcity);
+    game_remove_city(&wld, pcity);
   } city_list_iterate_end;
 
   if (full) {

Modified: trunk/server/citytools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/citytools.c?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/server/citytools.c    (original)
+++ trunk/server/citytools.c    Mon May  8 15:35:43 2017
@@ -1780,7 +1780,7 @@
   } players_iterate_end;
 
   fc_allocate_mutex(&game.server.mutexes.city_list);
-  game_remove_city(pcity);
+  game_remove_city(&wld, pcity);
   fc_release_mutex(&game.server.mutexes.city_list);
 
   /* Remove any extras that were only there because the city was there. */

Modified: trunk/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unittools.c?rev=35461&r1=35460&r2=35461&view=diff
==============================================================================
--- trunk/server/unittools.c    (original)
+++ trunk/server/unittools.c    Mon May  8 15:35:43 2017
@@ -1762,7 +1762,7 @@
                             API_TYPE_STRING, unit_loss_reason_name(reason));
 
   script_server_remove_exported_object(punit);
-  game_remove_unit(punit);
+  game_remove_unit(&wld, punit);
   punit = NULL;
 
   if (NULL != ptrans) {


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to