Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2003:
[Freeciv-Dev] Re: (PR#3906) Negative shields
Home

[Freeciv-Dev] Re: (PR#3906) Negative shields

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3906) Negative shields
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Apr 2003 10:31:50 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Raimar Falke wrote:
> On Tue, Apr 01, 2003 at 08:17:19AM -0800, Jason Short wrote:
> 
>>[rfalke - Mon Mar 31 19:47:25 2003]:
>>
>>
>>>I just got this message:
>>>
>>>Spiel: Karawane hilft, Leonardos Werkstatt in Haarlem zu bauen
>>>(Restkosten: -4).
>>>
>>>The last part should be replaced with "adding 4 extra shields to the
>>>stock" or similar.
>>
>>I don't understand the problem.
> 
> 
> Costs are positive. There are no negative costs. Hmmm the english
> version
> 
>   "Game: Your %s helps build the %s in %s (%d remaining)."
> 
> doesn't speak about cost. But I also think that you can't have
> negative remaining of something.
> 
> If remaining<0 the message should be:
> 
>   "Game: Your %s helps build the %s in %s (finished). "\
>   "Adding the extra %d shields to the stock.", -remaining

How about this?

jason



Index: server/unithand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unithand.c,v
retrieving revision 1.255
diff -u -r1.255 unithand.c
--- server/unithand.c   2003/02/17 22:49:28     1.255
+++ server/unithand.c   2003/04/01 18:27:18
@@ -1098,6 +1098,7 @@
 {
   struct unit *punit = player_find_unit_by_id(pplayer, req->unit_id);
   struct city *pcity_dest = find_city_by_id(req->city_id);
+  const char *text;
 
   if (!punit || !unit_flag(punit, F_HELP_WONDER) || !pcity_dest
       || !unit_can_help_build_wonder(punit, pcity_dest)) {
@@ -1117,12 +1118,18 @@
   pcity_dest->caravan_shields += unit_type(punit)->build_cost;
 
   conn_list_do_buffer(&pplayer->connections);
+
+  if (build_points_left(pcity_dest) >= 0) {
+    text = _("Game: Your %s helps build the %s in %s (%d remaining).");
+  } else {
+    text = _("Game: Your %s helps build the %s in %s (%d surplus).");
+  }
   notify_player_ex(pplayer, pcity_dest->x, pcity_dest->y, E_NOEVENT,
-                  _("Game: Your %s helps build the %s in %s (%d remaining)."), 
+                  text, /* Must match arguments below. */
                   unit_name(punit->type),
                   get_improvement_type(pcity_dest->currently_building)->name,
                   pcity_dest->name, 
-                  build_points_left(pcity_dest));
+                  abs(build_points_left(pcity_dest)));
 
   wipe_unit(punit);
   send_player_info(pplayer, pplayer);

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