Author: cazfi
Date: Sun Oct  2 07:59:59 2016
New Revision: 33958

URL: http://svn.gna.org/viewcvs/freeciv?rev=33958&view=rev
Log:
Do not try to make 'disband' act like 'help wonder' for caravans.

Reported by Sveinung Kvilhaugsvik <sveinung>

See bug #23911

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=33958&r1=33957&r2=33958&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Sun Oct  2 07:59:59 2016
@@ -2561,6 +2561,8 @@
                             struct unit *punit,
                             struct city *pcity)
 {
+  int shields;
+
   /* Sanity check: The actor still exists. */
   fc_assert_ret_val(pplayer, FALSE);
   fc_assert_ret_val(punit, FALSE);
@@ -2568,19 +2570,14 @@
   /* Sanity check: The target city still exists. */
   fc_assert_ret_val(pcity, FALSE);
 
+  shields = unit_disband_shields(punit);
+
   /* Add the shields from recycling the unit to the city's current
    * production. */
-  pcity->shield_stock += unit_disband_shields(punit);
-
-  if (unit_can_do_action(punit, ACTION_HELP_WONDER)) {
-    /* Count this just like a caravan that was added to a wonder.
-     * However don't actually give the city the extra shields. Switching
-     * to a wonder later in the turn will give the extra shields back. */
-    pcity->caravan_shields += unit_build_shield_cost(punit);
-  } else {
-    /* If we change production later at this turn. No penalty is added. */
-    pcity->disbanded_shields += unit_disband_shields(punit);
-  }
+  pcity->shield_stock += shields;
+
+  /* If we change production later at this turn. No penalty is added. */
+  pcity->disbanded_shields += shields;
 
   notify_player(pplayer, city_tile(pcity), E_CARAVAN_ACTION, ftc_server,
                 /* TRANS: ... Ironclad ... New York */


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

Reply via email to