Author: sveinung
Date: Sun Aug  9 01:16:44 2015
New Revision: 29413

URL: http://svn.gna.org/viewcvs/freeciv?rev=29413&view=rev
Log:
Try to save an untransferable game loss unit

See bug #23691

Modified:
    branches/S2_6/server/citytools.c

Modified: branches/S2_6/server/citytools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/citytools.c?rev=29413&r1=29412&r2=29413&view=diff
==============================================================================
--- branches/S2_6/server/citytools.c    (original)
+++ branches/S2_6/server/citytools.c    Sun Aug  9 01:16:44 2015
@@ -612,18 +612,23 @@
                 unit_rule_name(punit),
                 nation_rule_name(nation_of_player(from_player)));
 
-      if (verbose) {
-        notify_player(from_player, unit_tile(punit),
-                      E_UNIT_LOST_MISC, ftc_server,
-                      /* TRANS: Americans ... Leader */
-                      _("The %s already have a %s. Can't transfer yours."),
-                      nation_plural_for_player(to_player),
-                      unit_tile_link(punit));
-      }
-
-      /* TODO: What should be done when the unit is a game loss unit? Maybe
-       * it should be bounced rather than killed? */
-      wipe_unit(punit, ULR_CITY_LOST, NULL);
+      if (utype_has_flag(unit_type(punit), UTYF_GAMELOSS)) {
+        /* Try to save game loss units. */
+        bounce_unit(punit, verbose);
+      } else {
+        /* Kill the unique unit. */
+
+        if (verbose) {
+          notify_player(from_player, unit_tile(punit),
+                        E_UNIT_LOST_MISC, ftc_server,
+                        /* TRANS: Americans ... Leader */
+                        _("The %s already have a %s. Can't transfer yours."),
+                        nation_plural_for_player(to_player),
+                        unit_tile_link(punit));
+        }
+
+        wipe_unit(punit, ULR_CITY_LOST, NULL);
+      }
 
       return;
     }


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

Reply via email to