Author: sveinung
Date: Mon Jan 12 12:37:43 2015
New Revision: 27628

URL: http://svn.gna.org/viewcvs/freeciv?rev=27628&view=rev
Log:
Support capturing all units at a city tile but don't allow it yet.

This will let the rule that units in a city can't be captured move to the
ruleset when unit capture becomes action enabler controlled.

See patch #5689

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=27628&r1=27627&r2=27628&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Mon Jan 12 12:37:43 2015
@@ -214,12 +214,14 @@
                              struct unit *punit,
                              struct tile *pdesttile)
 {
+  struct city *pcity;
   char capturer_link[MAX_LEN_LINK];
   const char *capturer_nation = nation_plural_for_player(pplayer);
 
   /* N.B: unit_link() always returns the same pointer. */
   sz_strlcpy(capturer_link, unit_link(punit));
 
+  pcity = tile_city(pdesttile);
   unit_list_iterate(pdesttile->units, to_capture) {
     struct player *uplayer = unit_owner(to_capture);
     const char *victim_link;
@@ -245,6 +247,11 @@
                   /* TRANS: <unit> ... <Poles> */
                   _("Your %s was captured by the %s."),
                   victim_link, capturer_nation);
+
+    if (NULL != pcity) {
+      /* The captured unit is in a city. Bounce it. */
+      bounce_unit(to_capture, TRUE);
+    }
   } unit_list_iterate_end;
 
   /* Subtract movement point from capturer */


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

Reply via email to