[Freeciv-Dev] (PR#13902) Grasslands bug
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=13902 >
> [mstefek - Wed Sep 07 14:34:22 2005]:
>
> > [guest - Wed Sep 07 12:05:21 2005]:
> >
> > I think it would be a good idea to include the despotism penalty in the
> > middle-mouse-button popup.
> >
> This is a patch for S2_0.
> --
> mateusz
And this is a patch for HEAD
--
mateusz
Index: client/text.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/text.c,v
retrieving revision 1.50
diff -u -r1.50 text.c
--- client/text.c 25 Aug 2005 20:36:12 -0000 1.50
+++ client/text.c 8 Sep 2005 07:01:34 -0000
@@ -39,12 +39,28 @@
const char *get_tile_output_text(const struct tile *ptile)
{
static struct astring str = ASTRING_INIT;
-
+ int i;
+ char output_text[O_MAX][16];
+ struct government *gov;
+
+ gov = get_gov_pplayer(game.player_ptr);
+
+ for (i = 0; i < O_MAX; i++) {
+ int before_penalty = gov->output_before_penalty[i];
+ int x = get_output_tile(ptile, i);
+
+ if (before_penalty > 0 && x > before_penalty) {
+ my_snprintf(output_text[i], sizeof(output_text[i]), "%d(-1)", x);
+ } else {
+ my_snprintf(output_text[i], sizeof(output_text[i]), "%d", x);
+ }
+ }
+
astr_clear(&str);
- astr_add_line(&str, "%d/%d/%d",
- get_output_tile(ptile, O_FOOD),
- get_output_tile(ptile, O_SHIELD),
- get_output_tile(ptile, O_TRADE));
+ astr_add_line(&str, "%s/%s/%s",
+ output_text[O_FOOD],
+ output_text[O_SHIELD],
+ output_text[O_TRADE]);
return str.str;
}
|
|