Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: (PR#6992) Barbarian bug
Home

[Freeciv-Dev] Re: (PR#6992) Barbarian bug

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#6992) Barbarian bug
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 30 Nov 2003 09:57:54 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6992 >

On Sun, 30 Nov 2003, Per I. Mathisen wrote:
> The barb code really needs a cleaning up. For now, I have made a braindead
> patch for S1_14 which should recover completely when this bug arises.
> Attached. I suggest it is committed before 1.14.1 is released.

Here is a better patch that fixes the actual problem. The same problem may
exist in the 'create dead' patch.

  - Per

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.246.2.4
diff -u -r1.246.2.4 plrhand.c
--- server/plrhand.c    15 Nov 2003 11:21:50 -0000      1.246.2.4
+++ server/plrhand.c    30 Nov 2003 17:56:22 -0000
@@ -1728,6 +1728,13 @@
   int i, j;
   struct player *cplayer;
 
+  if (game.nplayers >= MAX_NUM_PLAYERS) {
+    /* No space to make additional player */
+    freelog(LOG_NORMAL, "Could not throw %s into civil war - too many players",
+            pplayer->name);
+    return;
+  }
+
   cplayer = split_player(pplayer);
 
   /* So that clients get the correct game.nplayers: */

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