Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] (PR#7413) transfered/rehomed allied units
Home

[Freeciv-Dev] (PR#7413) transfered/rehomed allied units

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: ggracian@xxxxxxx
Subject: [Freeciv-Dev] (PR#7413) transfered/rehomed allied units
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 21 Feb 2004 13:17:43 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7413 >

> [eneg - Wed Feb 11 20:20:38 2004]:
> 
> Hello, 
> 
> - I'm allied with a player. 
> - One of his cities city support an unit currently located in 
>   one of my cities.
> - The allied city is took/destroyed by enemy.
> - The unit is rehomed in my city.
> - I'm not warned (my ally has transfer info in cvs head, but 
>   not in 1.14.1).
> 
> Should units be rehomed in allied cities and given to the ally?

Certainly not, since there is currently no other way to transfer units
to an ally.  Of course this means such units will generally be destroyed.

This patch should make the change.

jason

Index: server/citytools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/citytools.c,v
retrieving revision 1.253
diff -u -r1.253 citytools.c
--- server/citytools.c  2004/02/19 20:01:07     1.253
+++ server/citytools.c  2004/02/21 21:17:04
@@ -746,7 +746,8 @@
      cities or maybe destroyed */
   unit_list_iterate_safe(*units, vunit) {
     struct city *new_home_city = map_get_city(vunit->x, vunit->y);
-    if (new_home_city && new_home_city != exclude_city) {
+    if (new_home_city && new_home_city != exclude_city
+       && city_owner(new_home_city) == unit_owner(vunit)) {
       /* unit is in another city: make that the new homecity,
         unless that city is actually the same city (happens if disbanding) */
       transfer_unit(vunit, new_home_city, verbose);

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