Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2005:
[Freeciv-Dev] Re: (PR#14586) civclient: government.c:80: get_gov_pplayer
Home

[Freeciv-Dev] Re: (PR#14586) civclient: government.c:80: get_gov_pplayer

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: yautja@xxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#14586) civclient: government.c:80: get_gov_pplayer: Assertion
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 16 Nov 2005 14:32:24 -0800
Reply-to: bugs@xxxxxxxxxxx

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

On Fri, 11 Nov 2005, Brendon wrote:
> HEAD
>
> 1. Start a game
> 2. Global observe/obs
> 3. Middle click on terrain
>
> civclient: government.c:80: get_gov_pplayer: Assertion `pplayer !=
> ((void *)0)' failed.

Patch that fixes this attached. Jason, take a look at it, please. I am not
sure if this is how the global observer is supposed to work.

  - Per

Index: client/text.c
===================================================================
--- client/text.c       (revision 11234)
+++ client/text.c       (working copy)
@@ -42,9 +42,13 @@
   int i;
   char output_text[O_MAX][16];
   struct government *gov;
-  
-  gov = get_gov_pplayer(game.player_ptr);
 
+  if (!game.player_ptr) {
+    gov = game.government_when_anarchy;
+  } else {
+    gov = get_gov_pplayer(game.player_ptr);
+  }
+
   for (i = 0; i < O_MAX; i++) {
     int before_penalty = gov->output_before_penalty[i];
     int x = get_output_tile(ptile, i);

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