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

> [EMAIL PROTECTED] - Di 18. Sep 2007, 20:58:36]:
> 
> Crash issues with FreeCiv SDL Client 2.1.0 beta 6
> 
> In the current game, when I try to bribe a unit with a spy, the
> program
> crashes.  I am asked if I want to bribe the unit, with a reasonable
> value for
> the bribe and an accurate value for the amount in the treasury.  After
> I accept
> the bribe, the program crashes.  The MS-Windoze crash message is as
> follows.
> 
> CIVCLIENT caused an invalid page fault in
> module CIVCLIENT.EXE at 0177:004cc490.
> Registers:
> EAX=00000000 CS=0177 EIP=004cc490 EFLGS=00010206
> EBX=00ceb690 SS=017f ESP=00adf7d0 EBP=00adf7e8
> ECX=00af087c DS=017f ESI=0000fdd4 FS=4637
> EDX=000117b7 ES=017f EDI=00000000 GS=0000
> Bytes at CS:EIP:
> 8b 00 89 04 24 e8 16 6e f7 ff 85 c0 74 e1 a1 60
> Stack dump:
> dbb896d0 00000001 bff92b49 0061e96c 0003bbc9 00000000 00adf808
> 004ef085
> 00ceb690 000001cb 0000013b 0061e96c 0003bbc9 00000000 00adf828
> 004aaeb8
> 
> After the crash, the stderr.txt and stdout.txt files were empty.
> 
> This is a very consistent crash.  Every time I try this, even with
> other spies
> bribing other units after restarting the game, the client crashes.
> This also
> happens when I try to incite a revolt in a neighboring city.
> 
> It also crashes when pressing F5 while researching Future Tech.  As a
> side
> note, when you have nothing left to research, the science screen does
> not
> present Future Tech.  It only gives "None".
> 

The attached patch fixes the bribe/incite crashes. Now I only need to
find a savegame that allows researching Future Tech...

Index: client/gui-sdl/diplomat_dialog.c
===================================================================
--- client/gui-sdl/diplomat_dialog.c	(revision 13783)
+++ client/gui-sdl/diplomat_dialog.c	(working copy)
@@ -1027,13 +1027,12 @@
 static int diplomat_incite_yes_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-    popdown_incite_dialog();
-  
     if (game_find_unit_by_number(pIncite_Dlg->diplomat_id)
        && game_find_city_by_number(pIncite_Dlg->diplomat_target_id)) {  
       request_diplomat_action(DIPLOMAT_INCITE, pIncite_Dlg->diplomat_id,
                                          pIncite_Dlg->diplomat_target_id, 0);       
     }
+    popdown_incite_dialog();
   }  
   return -1;
 }
@@ -1272,13 +1271,12 @@
 static int diplomat_bribe_yes_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
-    popdown_bribe_dialog();
-    
-    if (game_find_unit_by_number(pIncite_Dlg->diplomat_id)
-       && game_find_city_by_number(pIncite_Dlg->diplomat_target_id)) {  
+    if (game_find_unit_by_number(pBribe_Dlg->diplomat_id)
+       && game_find_unit_by_number(pBribe_Dlg->diplomat_target_id)) {  
        request_diplomat_action(DIPLOMAT_BRIBE, pBribe_Dlg->diplomat_id,
                                           pBribe_Dlg->diplomat_target_id, 0);       
     }
+    popdown_bribe_dialog();
   }  
   return -1;
 }
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to