Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2005:
[Freeciv-Dev] (PR#13301) better behavior of aifill player removal
Home

[Freeciv-Dev] (PR#13301) better behavior of aifill player removal

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#13301) better behavior of aifill player removal
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Jun 2005 16:09:42 -0700
Reply-to: bugs@xxxxxxxxxxx

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

This patch changes aifill player removal in two ways.

1.  An off-by-one bug prevented player 0 from ever being removed.

2.  Created players won't be removed now.  They behave the same as
connected players.  This means /create again has some use.  I still
think it *might* be good to remove it however.  We'll see.

-jason

Index: server/srv_main.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/srv_main.c,v
retrieving revision 1.271
diff -u -r1.271 srv_main.c
--- server/srv_main.c   14 Jun 2005 18:49:09 -0000      1.271
+++ server/srv_main.c   20 Jun 2005 23:08:03 -0000
@@ -1472,10 +1472,11 @@
   }
 
   remove = game.info.nplayers - 1;
-  while (game.info.nplayers > amount + observers && remove > 0) {
+  while (game.info.nplayers > amount + observers && remove >= 0) {
     struct player *pplayer = get_player(remove);
 
-    if (!pplayer->is_observer && !pplayer->is_connected) {
+    if (!pplayer->is_observer && !pplayer->is_connected
+       && !pplayer->was_created) {
       server_remove_player(pplayer);
     }
     remove--;

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#13301) better behavior of aifill player removal, Jason Short <=