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

2009/4/22 Marko Lindqvist <cazf...@gmail.com>:
> 2009/4/12 Daniel Doran <dado...@sbcglobal.net>:
>>
>> The Freeciv Help browser shows, for all Wonders (at least in the default
>> ruleset)  "Requirement: 0" and "Obsolete by: " {the technology required
>> to build the wonder}
>
>  Attached patch should fix this along some potential crashes.

 S2_1 version


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2008-01-22 03:47:26.000000000 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2009-04-30 01:00:54.000000000 +0300
@@ -492,6 +492,7 @@
 		    get_req_source_text(&preq->source, req_buf,
 		    sizeof(req_buf)));
       i++;
+      break;
     } requirement_vector_iterate_end;
 /*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
@@ -522,8 +523,6 @@
 
     sprintf(buf, "%d", impr_build_shield_cost(which));
     SetWindowText(help_ilabel[1], buf);
-    sprintf(buf, "%d", imp->upkeep);
-    SetWindowText(help_ilabel[3], buf);
 
     /* FIXME: this should show ranges and all the MAX_NUM_REQS reqs. 
      * Currently it's limited to 1 req but this code is partially prepared
@@ -531,12 +530,19 @@
      * definition. */
     i = 0;
     requirement_vector_iterate(&imp->reqs, preq) {
-      SetWindowText(help_ilabel[5 + i],
+      SetWindowText(help_ilabel[3 + i],
 		    get_req_source_text(&preq->source, req_buf,
 		    sizeof(req_buf)));
       i++;
+      break;
     } requirement_vector_iterate_end;
-/*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
+    if (imp->obsolete_by != A_LAST) {
+      SetWindowText(help_ilabel[5],
+                    advance_name_for_player(game.player_ptr,
+                                            imp->obsolete_by));
+    } else {
+      SetWindowText(help_ilabel[5], _("None"));
+    }
   }
   else {
     /* can't find wonder */
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to