Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] Re: (PR#4779) teams bug: embassy lost if civil war
Home

[Freeciv-Dev] Re: (PR#4779) teams bug: embassy lost if civil war

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#4779) teams bug: embassy lost if civil war
From: "ue80@xxxxxxxxxxxxxxxxxxxxx" <ue80@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 7 Aug 2003 10:00:35 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Aug 07, 2003 at 05:32:45AM -0700, Per I. Mathisen wrote:
> 
> ---------- Forwarded message ----------
> From: "ue80@xxxxxxxxxxxxxxxxxxxxx" <ue80@xxxxxxxxxxxxxxxxxxxxx>
> 
> [...]
> 
> There is an easy way to remove the embassy from the other
> player ... bring him into civil war.
> 
> (a bug in teamgames, teamed players should never lose embassy )

ok ...

and a patch (not tested ...)

Thomas
-- 
Thomas Strub  ***  eMail ue80@xxxxxxxxxxxxxxxxxxxxx
jb: people are stupid, they don't want to learn.

Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.284
diff -u -r1.284 plrhand.c
--- server/plrhand.c    2003/08/04 15:42:47     1.284
+++ server/plrhand.c    2003/08/07 16:56:53
@@ -1651,6 +1651,14 @@
   pplayer->research.bulbs_researched = 0;
   pplayer->embassy = 0; /* all embassys destroyed */
 
+  /* kludge to give splitted player the embassies to his allies back */
+  players_iterate(pdest) {
+      if ((pplayer->team == pdest->team)
+          && (pplayer->player_no != pdest->player_no)) {
+        pplayer->embassy |= (1 << pdest->player_no);
+      }
+    } players_iterate_end
+  
   player_limit_to_government_rates(pplayer);
 
   /* copy the maps */

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