Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6407) Barbarian teams win
Home

[Freeciv-Dev] Re: (PR#6407) Barbarian teams win

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: chrisk@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6407) Barbarian teams win
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Sun, 12 Oct 2003 23:53:04 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 6 Oct 2003, Per I. Mathisen wrote:
> On Mon, 6 Oct 2003, Christian Knoke wrote:
> > When you put Barbarians into a team with AI's, some change of state in the
> > Barbarians causes a victory for the AI team.
>
> Barbarians should never be added to a team. That this is allowed by the
> server is a bug.

And the patch.

  - Per

Index: server/stdinhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/stdinhand.c,v
retrieving revision 1.296
diff -u -r1.296 stdinhand.c
--- server/stdinhand.c  9 Oct 2003 12:06:22 -0000       1.296
+++ server/stdinhand.c  13 Oct 2003 06:52:24 -0000
@@ -2878,6 +2878,11 @@
     cmd_reply(CMD_TEAM, caller, C_SYNTAX, _("Bad team name."));
     return;
   }
+  if (is_barbarian(pplayer)) {
+    /* This can happen if we change team settings on a loaded game. */
+    cmd_reply(CMD_TEAM, caller, C_SYNTAX, _("Cannot team a barbarian."));
+    return;
+  }
   team_add_player(pplayer, arg[1]);
   cmd_reply(CMD_TEAM, caller, C_OK, _("Player %s set to team %s."),
            pplayer->name, team_get_by_id(pplayer->team)->name);

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