Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8285) War with team members
Home

[Freeciv-Dev] Re: (PR#8285) War with team members

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: matusik_s@xxxxx
Subject: [Freeciv-Dev] Re: (PR#8285) War with team members
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Fri, 26 Mar 2004 10:01:26 -0800
Reply-to: rt@xxxxxxxxxxx

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

On Mon, 22 Mar 2004, mateusz stefek wrote:
> It is possible.
> Suppose that A and B are playing in the same team.
> A forms an alliance with C. Then B declares war on C.
> Through cascading war declaration B also declares war on A.

The solution is not good. You cancel the alliance with your team mate??

Instead, alliances with non-team mates should not be possible. Much more
sane. See attached patch.

  - Per

Index: common/player.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/player.c,v
retrieving revision 1.137
diff -u -r1.137 player.c
--- common/player.c     25 Feb 2004 16:13:29 -0000      1.137
+++ common/player.c     26 Mar 2004 17:59:34 -0000
@@ -48,12 +48,17 @@
 {
   players_iterate(pplayer) {
     enum diplstate_type ds = pplayer_get_diplstate(p1, pplayer)->type;
+
     if (pplayer != p1
         && pplayer != p2
         && pplayers_allied(p2, pplayer)
         && ds == DS_WAR /* do not count 'never met' as war here */
         && pplayer->is_alive) {
       return FALSE;
+    }
+    if ((p1->team != TEAM_NONE || p2->team != TEAM_NONE)
+        && p1->team != p2->team) {
+      return FALSE; /* Cannot ally outside team */
     }
   } players_iterate_end;
   return TRUE;

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