[freeciv-ai] Re: [Freeciv-Dev] settlers & players territory
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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 <=
|
|