Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2003:
[Freeciv-Dev] Re: (PR#3380) Popup city button for captured city causes c
Home

[Freeciv-Dev] Re: (PR#3380) Popup city button for captured city causes c

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kenn@xxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#3380) Popup city button for captured city causes crash
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 16 Feb 2003 19:26:18 -0800
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:
> [guest - Tue Feb 11 04:13:30 2003]:
> 
> 
>>If one of your cities is captured, and you select the "... conquered ...
>>and looted ..." in the message box, then press the Popup City button,
>>you'll get something like:
>>
>>civclient: citydlg_common.c:319: get_city_citizen_types: Assertion `i ==
>>pcity->size' failed.
>>Aborted (core dumped)
>>
>>Feb 7 cvs, gtk2 client on Red Hat 8.  Savegame attached; join as kenn.

> What should the behavior here be?

> 2. The city dialog does not popup.

Patch attached.  Note that this might fail in some cases (allies, cities 
we have spies in, etc.).  Most of these features aren't implemented yet; 
I don't know if it will have any problems with the current code.

jason

Index: client/messagewin_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/messagewin_common.c,v
retrieving revision 1.10
diff -u -r1.10 messagewin_common.c
--- client/messagewin_common.c  2002/12/18 19:05:21     1.10
+++ client/messagewin_common.c  2003/02/17 03:22:51
@@ -199,11 +199,14 @@
       center_tile_mapcanvas(x, y);
     }
 
-    if (pcity) {
+    if (pcity && city_owner(pcity) == game.player_ptr) {
       /* If the event was the city being destroyed, pcity will be NULL
-       * and we'd better not try to pop it up.  In this case, it would
-       * be better if the popup button weren't highlighted at all, but
-       * that's OK. */
+       * and we'd better not try to pop it up.  It's also possible that
+       * events will happen on enemy cities; we generally don't want to pop
+       * those dialogs up either (although it's hard to be certain).
+       *
+       * In both cases, it would be better if the popup button weren't
+       * highlighted at all - this is left up to the GUI. */
       popup_city_dialog(pcity, FALSE);
     }
   }

[Prev in Thread] Current Thread [Next in Thread]