Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2005:
[Freeciv-Dev] (PR#13912) duplicate orders-cancelled messages
Home

[Freeciv-Dev] (PR#13912) duplicate orders-cancelled messages

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13912) duplicate orders-cancelled messages
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Sep 2005 12:11:34 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13912 >

> [jdorje - Wed Sep 07 16:51:12 2005]:
> 
> Now that these have the same event type they always show up right 
> together: two separate messages appear when orders are cancelled.  This 
> patch fixes it.

And this trivial patch fixes it for 2.0 (and changes E_NOEVENT to
E_UNIT_ORDERS).

-jason

Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.306.2.17
diff -p -u -r1.306.2.17 unittools.c
--- server/unittools.c  20 Aug 2005 19:58:25 -0000      1.306.2.17
+++ server/unittools.c  8 Sep 2005 19:11:15 -0000
@@ -2520,7 +2520,12 @@ static void wakeup_neighbor_sentries(str
       if (punit != ppatrol
          && unit_has_orders(ppatrol)
          && ppatrol->orders.vigilant) {
-       (void) maybe_cancel_patrol_due_to_enemy(ppatrol);
+       if (maybe_cancel_patrol_due_to_enemy(ppatrol)) {
+         notify_player_ex(unit_owner(ppatrol), ppatrol->tile, E_UNIT_ORDERS, 
+                          _("Game: Your %s cancelled patrol order because it "
+                            "encountered a foreign unit."),
+                          unit_name(ppatrol->type));
+       }
       }
     } unit_list_iterate_end;
   } square_iterate_end;
@@ -2844,10 +2849,6 @@ static bool maybe_cancel_goto_due_to_ene
   
   if (is_non_allied_unit_tile(ptile, pplayer) 
       || is_non_allied_city_tile(ptile, pplayer)) {
-    notify_player_ex(pplayer, punit->tile, E_NOEVENT,
-                     _("Game: %s aborted GOTO "
-                       "as there are units in the way."),
-                     unit_type(punit)->name);
     return TRUE;
   }
 
@@ -2887,9 +2888,6 @@ static bool maybe_cancel_patrol_due_to_e
 
   if (cancel) {
     handle_unit_activity_request(punit, ACTIVITY_IDLE);
-    notify_player_ex(unit_owner(punit), punit->tile, E_NOEVENT, 
-                    _("Game: Your %s cancelled patrol order because it "
-                      "encountered a foreign unit."), unit_name(punit->type));
   }
 
   return cancel;

[Prev in Thread] Current Thread [Next in Thread]