Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2005:
[Freeciv-Dev] (PR#12018) observer player sends game state before game st
Home

[Freeciv-Dev] (PR#12018) observer player sends game state before game st

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#12018) observer player sends game state before game state exists
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 Oct 2005 23:36:50 -0700
Reply-to: bugs@xxxxxxxxxxx

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

> [jdorje - Sun Oct 02 16:42:05 2005]:
> 
> When I connect to a pregame and do /observe the client spews out:
> 
> 0: Cannot find any palace building
> 0: Cannot find any land defend building
> 0: Cannot find any palace building
> 0: Cannot find any land defend building
> 
> this is with 2.0.  Of course rulesets haven't been sent by now so this 
> isn't an error.

Here's a patch to fix it.  I also changed the LOG_FATAL to LOG_ERROR
since...it isn't fatal.

-jason

? data/amplio
? data/amplio.tilespec
Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.408.2.28
diff -p -u -r1.408.2.28 packhand.c
--- client/packhand.c   14 Aug 2005 00:23:11 -0000      1.408.2.28
+++ client/packhand.c   3 Oct 2005 06:34:58 -0000
@@ -1412,13 +1412,15 @@ void handle_game_info(struct packet_game
      * to work.
      */
     game.palace_building = get_building_for_effect(EFT_CAPITAL_CITY);
-    if (game.palace_building == B_LAST) {
-      freelog(LOG_FATAL, "Cannot find any palace building");
+    if (game.palace_building == B_LAST
+       && get_client_state() == CLIENT_GAME_RUNNING_STATE) {
+      freelog(LOG_ERROR, "Cannot find any palace building");
     }
 
     game.land_defend_building = get_building_for_effect(EFT_LAND_DEFEND);
-    if (game.land_defend_building == B_LAST) {
-      freelog(LOG_FATAL, "Cannot find any land defend building");
+    if (game.land_defend_building == B_LAST
+       && get_client_state() == CLIENT_GAME_RUNNING_STATE) {
+      freelog(LOG_ERROR, "Cannot find any land defend building");
     }
 
     improvement_status_init(game.improvements,

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