[Freeciv-Dev] Settlers are no more afraid of allies (PR#1931)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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.
one player near| 1<<player_no | 1<<player_no
more players near| 0 | bitfield
noone near | 0xFFFFFFFF | 0
+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])
- && (territory[x][y]&(1<<pplayer->player_no))
New version which uses bitvectors is attached.
is replaced by
It has the same meaning.
Description: Text Data
|[Prev in Thread]
||[Next in Thread]|
- [Freeciv-Dev] Settlers are no more afraid of allies (PR#1931),
Mateusz Stefek <=