[Freeciv-Dev] Re: (PR#18617) gui-xaw: science dialog cleanup/fix
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: |
[Freeciv-Dev] Re: (PR#18617) gui-xaw: science dialog cleanup/fix |
From: |
"Egor Vyscrebentsov" <evyscr@xxxxxxxxx> |
Date: |
Sun, 16 Jul 2006 09:58:53 -0700 |
Reply-to: |
bugs@xxxxxxxxxxx |
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=18617 >
On Sat, 15 Jul 2006 06:33:23 -0700
Egor Vyscrebentsov wrote:
> There is an error in xaw science dialog change callback,
> which cause client to crash if technology goal is not set.
> Just several unnecesary wrong lines.
Similar unnecessary lines in goal change callback. Hopefully they
don't cause crashes, but should be removed too.
--
Thanks, evyscr
Index: client/gui-xaw/repodlgs.c
===================================================================
--- client/gui-xaw/repodlgs.c (revision 12101)
+++ client/gui-xaw/repodlgs.c (working copy)
@@ -409,22 +409,13 @@
void science_change_callback(Widget w, XtPointer client_data,
XtPointer call_data)
{
- char current_text[512];
size_t to = (size_t) client_data;
Boolean b;
- struct player_research* research = get_player_research(game.player_ptr);
XtVaGetValues(science_help_toggle, XtNstate, &b, NULL);
if (b == TRUE) {
popup_help_dialog_typed(advances[to].name, HELP_TECH);
} else {
- my_snprintf(current_text, sizeof(current_text),
- _("Researching %s: %d/%d"),
- advances[to].name, research->bulbs_researched,
- total_bulbs_required(game.player_ptr));
-
- XtVaSetValues(science_current_label, XtNlabel, current_text, NULL);
-
dsend_packet_player_research(&aconnection, to);
}
}
@@ -435,20 +426,13 @@
void science_goal_callback(Widget w, XtPointer client_data,
XtPointer call_data)
{
- char goal_text[512];
size_t to = (size_t) client_data;
Boolean b;
XtVaGetValues(science_help_toggle, XtNstate, &b, NULL);
- if (b == TRUE)
+ if (b == TRUE) {
popup_help_dialog_typed(advances[to].name, HELP_TECH);
- else {
- my_snprintf(goal_text, sizeof(goal_text), _("Goal: %s (%d steps)"),
- advances[to].name,
- num_unknown_techs_for_goal(game.player_ptr, to));
-
- XtVaSetValues(science_goal_label, XtNlabel, goal_text, NULL);
-
+ } else {
dsend_packet_player_tech_goal(&aconnection, to);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#18617) gui-xaw: science dialog cleanup/fix,
Egor Vyscrebentsov <=
|
|