[Freeciv-Dev] Re: settlers & players territory
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Thu, Dec 06, 2001 at 10:09:42PM CET, I got a letter,
where mateusz stefek <matusik_s@xxxxx> told me, that...
> 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))
>
It looks ok to me.
> Is anyone cleaning up settlers.c?
http://pasky.ji.cz/cvsweb.cgi/freeciv/server/settlers.c?cvsroot=aiciv
Iterated thru whole file for now, however still work in progress, as I want to
keep it lying there for some time and then reiterate it with clean head to
catch possible errors and misinterpretations. If you want ro do it too, it
would be obviously great.
Natural city names not merged yet as I feel lazy today ;).
--
Petr "Pasky" Baudis
UN*X programmer, UN*X administrator, hobbies = IPv6, IRC, FreeCiv hacking
.
"A common mistake that people make, when trying to design
something completely foolproof is to underestimate the
ingenuity of complete fools."
-- Douglas Adams in Mostly Harmless
.
Public PGP key, geekcode and stuff: http://pasky.ji.cz/~pasky/
|
|