Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2002:
[freeciv-ai] Re: ai bodyguard code cleanup part#1

[freeciv-ai] Re: ai bodyguard code cleanup part#1

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: ai bodyguard code cleanup part#1
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Mon, 12 Aug 2002 23:43:24 +0000 (GMT)

On Sat, 10 Aug 2002, Gregory Berkolaiko wrote:
> More importantly, there is a check before that,
> if (buddy->ai.bodyguard == 0) continue;
> which means that if we got to "def = 0;", buddy has a bodyguard but is not
> aware of it.This is bad: we have a doubly linked pair and one of the
> links is broken.If you are seriously working on the bodyguards, you have
> to catch all such occurences and fix them or explain them.

Actually you are mistaken, the check is not to ensure we have a bodyguard,
but to the contrary, to check that the unit is one that _wants_ a
bodyguard. Bodyguard want is indicated by -1 or > 0. -1 is the magic
number, > 0 is because Syela's bodyguards lose their charge all the time
and need to get new ones so that the real problem can be hidden ;)

Or at least AFAIK. How really knows with Syela's code...


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