Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#5097) GAMELOSS doesn't work
Home

[Freeciv-Dev] Re: (PR#5097) GAMELOSS doesn't work

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#5097) GAMELOSS doesn't work
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Aug 2003 19:13:43 -0700
Reply-to: rt@xxxxxxxxxxxxxx

Jason Short wrote:
> If a GAMELOSS unit dies, pplayer->is_dying is set to TRUE and 
> pplayer->is_alive to FALSE.  But because is_alive is now FALSE, the 
> server doesn't know to kill off the player.  All kill_player() calls are 
> surrounded by "if (pplayer->is_alive)" checks.
> 
> Of course is_alive is checked in many other places, so the "dead" player 
> will probably be crippled.

Patch attached.

jason

? core.14602
? freeciv_admin_guide.txt
? rc
Index: common/player.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.h,v
retrieving revision 1.105
diff -u -r1.105 player.h
--- common/player.h     2003/08/14 19:07:01     1.105
+++ common/player.h     2003/08/15 02:12:35
@@ -180,8 +180,8 @@
   bool turn_done;
   int nturns_idle;
   bool is_alive;
-  bool is_dying;
-  bool got_tech;
+  bool is_dying; /* set once the player is in the process of dying */
+  bool got_tech; /* set once the player is fully dead */
   int revolution;
   bool capital; /* used to give player capital in first city. */
   int embassy;
Index: server/unittools.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/unittools.c,v
retrieving revision 1.241
diff -u -r1.241 unittools.c
--- server/unittools.c  2003/08/14 19:07:01     1.241
+++ server/unittools.c  2003/08/15 02:12:35
@@ -1597,7 +1597,6 @@
     gamelog(GAMELOG_NORMAL, _("Player %s lost a game loss unit and died"),
             unit_owner(punit)->name);
     unit_owner(punit)->is_dying = TRUE;
-    unit_owner(punit)->is_alive = FALSE;
   }
 
   game_remove_unit(punit);

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