Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13385) server crash in get_invention
Home

[Freeciv-Dev] (PR#13385) server crash in get_invention

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#13385) server crash in get_invention
From: "Mateusz Stefek" <mstefek@xxxxxxxxx>
Date: Thu, 30 Jun 2005 13:27:43 -0700
Reply-to: bugs@xxxxxxxxxxx

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

Another case of the same bug.
--
mateusz
Index: client/gui-gtk-2.0/gui_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/gui_main.c,v
retrieving revision 1.130
diff -u -r1.130 gui_main.c
--- client/gui-gtk-2.0/gui_main.c       21 Jun 2005 16:21:00 -0000      1.130
+++ client/gui-gtk-2.0/gui_main.c       30 Jun 2005 20:26:37 -0000
@@ -1497,7 +1497,8 @@
     char buf[512];
     struct player_research* research = get_player_research(game.player_ptr);
     
-    my_snprintf(buf, sizeof(buf),
+    if (get_player_research(game.player_ptr)->researching != A_UNSET) {
+      my_snprintf(buf, sizeof(buf),
            _("%s People\nYear: %s Turn: %d\nGold: %d\nNet Income: %d\n"
              "Tax:%d Lux:%d Sci:%d\nResearching %s: %d/%d\nGovernment: %s"),
            population_to_text(civ_population(game.player_ptr)),
@@ -1513,7 +1514,24 @@
            research->bulbs_researched,
            total_bulbs_required(game.player_ptr),
            get_government_name(game.player_ptr->government));
-    
+    } else {
+      my_snprintf(buf, sizeof(buf),
+           _("%s People\nYear: %s Turn: %d\nGold: %d\nNet Income: %d\n"
+             "Tax:%d Lux:%d Sci:%d\nResearching %s: %d/-\nGovernment: %s"),
+           population_to_text(civ_population(game.player_ptr)),
+           textyear(game.info.year), game.info.turn,
+           game.player_ptr->economic.gold,
+           player_get_expected_income(game.player_ptr),
+           game.player_ptr->economic.tax,
+           game.player_ptr->economic.luxury,
+           game.player_ptr->economic.science,
+
+           get_tech_name(game.player_ptr,
+                         research->researching),
+           research->bulbs_researched,
+           get_government_name(game.player_ptr->government));
+    }
+        
     p = gtk_window_new(GTK_WINDOW_POPUP);
     gtk_widget_set_app_paintable(p, TRUE);
     gtk_container_set_border_width(GTK_CONTAINER(p), 4);

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