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: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4779) teams bug: embassy lost if civil war
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Fri, 8 Aug 2003 14:05:57 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, 7 Aug 2003, ue80@xxxxxxxxxxxxxxxxxxxxx wrote:
> > 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 )
...
> and a patch (not tested ...)

A modified version of the patch attached, with a savegame for testing.

  - Per

"This is the future for the world we're in at the moment,"
promised Lawrence Di Rita, special assistant to Rumsfeld.
"We'll get better as we do it more often."

Attachment: civilwartest.sav.gz
Description: civilwartest.sav.gz

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    4 Aug 2003 15:42:47 -0000       1.284
+++ server/plrhand.c    8 Aug 2003 21:03:19 -0000
@@ -1649,7 +1649,17 @@
   }
   pplayer->economic.gold = cplayer->economic.gold;
   pplayer->research.bulbs_researched = 0;
-  pplayer->embassy = 0; /* all embassys destroyed */
+  pplayer->embassy = 0; /* all embassies destroyed */
+
+  /* give splitted player the embassies to his team mates back, if any */
+  if (pplayer->team != TEAM_NONE) {
+    players_iterate(pdest) {
+      if (pplayer->team == pdest->team
+          && pplayer != pdest) {
+        establish_embassy(pplayer, pdest);
+      }
+    } players_iterate_end;
+  }
 
   player_limit_to_government_rates(pplayer);
 

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