Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2001:
[Freeciv-Dev] settlers & players territory
Home

[Freeciv-Dev] settlers & players territory

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] settlers & players territory
From: "mateusz stefek" <matusik_s@xxxxx>
Date: Thu, 06 Dec 2001 22:09:42 +0100

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))

---

Is anyone cleaning up settlers.c?

---
mateusz

Attachment: enemy-territory.0.diff
Description: Binary data


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