Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2002:
[freeciv-ai] Re: [Freeciv-Dev] settlers & players territory
Home

[freeciv-ai] Re: [Freeciv-Dev] settlers & players territory

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mateusz stefek <matusik_s@xxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: [Freeciv-Dev] settlers & players territory
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 8 Aug 2002 21:46:49 +0000 (GMT)

On Thu, 6 Dec 2001, mateusz stefek wrote:
> With this patch autosettlers don't treat allies as enemies.
> (They used to do nothing if ally unit is near)
>
> I changed the meaning of territory[][] table.
>
>                        was             now
> one player near| 1<<player_no     | 1<<player_no
> more players near| 0              | bitfield
> noone near     | 0xFFFFFFFF       | 0
>
> Also added:
>
> +static int enemy_bits[MAX_NUM_PLAYERS];
> It is bitmask for each player recalculated each turn.
>
> It is used like:
> +     && !(territory[x][y]&enemy_bits[pplayer->player_no])
> instead of:
> -     && (territory[x][y]&(1<<pplayer->player_no))

Mateusz,

I think this patch is very good.

Can you make a new version of this patch, on top of my latest settlers.c
cleanup patch, where you make use the new bitvectors instead of all that
awkward and hard to read << & stuff?

Yours
Per



[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] Re: [Freeciv-Dev] settlers & players territory, Per I. Mathisen <=