Author: sveinung
Date: Wed Feb 17 14:45:33 2016
New Revision: 31958

URL: http://svn.gna.org/viewcvs/freeciv?rev=31958&view=rev
Log:
Remove redundant canceled orders notification.

To notify the player that the orders for his unit were canceled is redundant
when the last order was canceled because the unit needed an action decision.
The action selection dialog will pop up and notify the player. It didn't
abort the orders for a unit on a mission to some far away objective.

Reported by Marko Lindqvist <cazfi> and Jacob Nevins <jtn>

See bug #24414

Modified:
    branches/S2_6/server/unithand.c
    branches/S2_6/server/unittools.c

Modified: branches/S2_6/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unithand.c?rev=31958&r1=31957&r2=31958&view=diff
==============================================================================
--- branches/S2_6/server/unithand.c     (original)
+++ branches/S2_6/server/unithand.c     Wed Feb 17 14:45:33 2016
@@ -2247,9 +2247,9 @@
 
 /**************************************************************************
   Will try to move to/attack the tile dest_x,dest_y.  Returns TRUE if this
-  could be done, FALSE if it couldn't for some reason. Even if this
-  returns TRUE, unit may have died upon arrival to new tile.
-  
+  was done, FALSE if it wasn't for some reason. Even if this returns TRUE,
+  the unit may have died upon arrival to new tile.
+
   'igzoc' means ignore ZOC rules - not necessary for igzoc units etc, but
   done in some special cases (moving barbarians out of initial hut).
   Should normally be FALSE.
@@ -2320,6 +2320,8 @@
          * what to do. */
         send_unit_info(player_reply_dest(pplayer), punit);
 
+        /* The move wasn't done because the unit wanted the player to
+         * decide what to do. */
         return FALSE;
       } else if (!may_non_act_move(punit, pcity, pdesttile, igzoc)) {
         /* No action can be done. No regular move can be done. Attack isn't
@@ -2328,6 +2330,7 @@
                                       is_non_attack_unit_tile(pdesttile,
                                                               pplayer));
 
+        /* The move wasn't done because the unit couldn't do anything. */
         return FALSE;
       }
     }

Modified: branches/S2_6/server/unittools.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unittools.c?rev=31958&r1=31957&r2=31958&view=diff
==============================================================================
--- branches/S2_6/server/unittools.c    (original)
+++ branches/S2_6/server/unittools.c    Wed Feb 17 14:45:33 2016
@@ -4128,8 +4128,21 @@
         /* Movement failed (ZOC, etc.) */
         cancel_orders(punit, "  attempt to move failed.");
 
-        if (!player_is_watching(punit, fresh)) {
-          /* The player may have missed this. Inform him. */
+        if (!player_is_watching(punit, fresh)
+            /* The final move "failed" because the unit needs to ask the
+             * player what action it should take.
+             *
+             * The action decision request notifies the player. Its
+             * location at the unit's last order makes it clear to the
+             * player who the decision is for. ("The Spy I sent to Berlin
+             * has arrived.")
+             *
+             * A notification message is therefore redundant. */
+            && !(last_order
+                 && punit->action_decision_want == ACT_DEC_ACTIVE
+                 && punit->action_decision_tile == dst_tile)) {
+          /* The player may have missed this. No one else will announce it
+           * in a satisfying manner. Inform the player. */
           notify_player(pplayer, unit_tile(punit),
                         E_UNIT_ORDERS, ftc_server,
                         _("Orders for %s aborted because of failed move."),


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

Reply via email to