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

On Tue, Jul 15, 2008 at 1:50 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=40378 >
>
> This transaction appears to have no content
>
> In the SDL client, using the Dune modpack 
> (http://forum.freeciv.org/viewtopic.php?t=4892), after you research the 
> "Leadership Level One" tech, when you open the city view and click on the 
> change production button, the client crashes.
>
> Attached is a save file just after having researched "Leadership Level One" 
> which can be used for testing.
> _______________________________________________
> Freeciv-dev mailing list
> Freeciv-dev@gna.org
> https://mail.gna.org/listinfo/freeciv-dev
>
>

Patch attached.

Index: client/gui-sdl/wldlg.c
===================================================================
--- client/gui-sdl/wldlg.c	(revision 14996)
+++ client/gui-sdl/wldlg.c	(working copy)
@@ -761,12 +761,12 @@
 	  pBuf = create_iconlabel(NULL, pWidget->dst,
 		create_str16_from_char(utype_name_translation(utype_by_number(target.value)), adj_font(10)),
 				(WF_RESTORE_BACKGROUND|WF_FREE_DATA));
-	  pBuf->ID = MAX_ID - B_LAST - target.value;
+	  pBuf->ID = MAX_ID - cid_encode(target);
         } else {
 	  pBuf = create_iconlabel(NULL, pWidget->dst,
 	  create_str16_from_char(get_impr_name_ex(pEditor->pCity, target.value), adj_font(10)),
 				(WF_RESTORE_BACKGROUND|WF_FREE_DATA));
-	  pBuf->ID = MAX_ID - target.value;
+	  pBuf->ID = MAX_ID - cid_encode(target);
         }
         pBuf->string16->style |= SF_CENTER;
         set_wstate(pBuf, FC_WS_NORMAL);
@@ -1468,7 +1468,7 @@
       pText_Name = create_text_surf_smaller_that_w(pStr, pIcon->w - 4);
   
       if (pCity) {
-        turns = city_turns_to_build(pCity, cid_production(un->index), TRUE);
+        turns = city_turns_to_build(pCity, cid_production(cid_encode_unit(un)), TRUE);
         if (turns == FC_INFINITY) {
           my_snprintf(cBuf, sizeof(cBuf),
 		    _("(%d/%d/%d)\n%d/%d %s\nnever"),
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to