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

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. It
(cross-)compiles, but I cannot test it at the moment.


 - ML

diff -Nurd -X.diff_ignore freeciv/client/gui-win32/helpdlg.c freeciv/client/gui-win32/helpdlg.c
--- freeciv/client/gui-win32/helpdlg.c	2009-02-20 16:39:24.000000000 +0200
+++ freeciv/client/gui-win32/helpdlg.c	2009-04-22 16:42:01.000000000 +0300
@@ -494,6 +494,7 @@
 		    universal_name_translation(&preq->source, req_buf,
 		    sizeof(req_buf)));
       i++;
+      break;
     } requirement_vector_iterate_end;
 /*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
@@ -524,8 +525,6 @@
 
     sprintf(buf, "%d", impr_build_shield_cost(imp));
     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
@@ -533,11 +532,20 @@
      * definition. */
     i = 0;
     requirement_vector_iterate(&imp->reqs, preq) {
-      SetWindowText(help_ilabel[5 + i],
+      SetWindowText(help_ilabel[3 + i],
 		    universal_name_translation(&preq->source, req_buf,
 		    sizeof(req_buf)));
       i++;
+      break;
     } requirement_vector_iterate_end;
+    if (valid_advance(imp->obsolete_by)) {
+      SetWindowText(help_ilabel[5],
+                    advance_name_for_player(client.conn.playing,
+					    advance_number(imp->obsolete_by)));
+    } else {
+      SetWindowText(help_ilabel[5], _("None"));
+    }
+
 /*    create_tech_tree(help_improvement_tree, 0, imp->tech_req, 3);*/
   }
   else {
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to