Follow-up Comment #7, bug #14037 (project freeciv):

rework changing of homecity / rehome of units and cities

* rename transfer_unit() to rehome_unit()
* merge transfer_city() and transfer_city_units()
* no more teleport of units!

some definitions for different functions:

- change homecity of the unit
- takes care of owner
- does NOT move the unit
- change homecity of a unit
- only checks if unit exists
- calls unit_change_homecity_handling()
- calls handle_unit_change_homecity()
- calls handle_unit_change_homecity()
- transfers a city from one player to another
- units further away than distance given by kill_outside are killed
- possibility to also transfer all units to the new owner
- default: transfer only units at the city tile
- search new homecity for all supported units not on the city tile
- call to transfer_city()
- rehome all units and kill the city
- change homecity of unit to another city of the player
- the current homecity is NOT considered

> But, to answer you, I don't think in any case an unit have to > be moved.
For me the transfer_unit() would take only the unit > argument and look like:

> if find a new possible homecity { 
>  change_homecity(); 
>  return TRUE; 
>  } else { 
>  wipe_up(); 
>  return FALSE; 
>  } 

I decided to change it to a homeless unit. If no possible homecity can be
found, the current homecity is the last city of this player ...

This patch also solves bug #14017

(file #6360)

Additional Item Attachment:

File name: 0001-rework-changing-of-homecity-rehome-of-units-and-ci.patch
Size:33 KB


Reply to this item at:


  Nachricht geschickt von/durch Gna!

Freeciv-dev mailing list

Reply via email to