Complete.Org: Mailing Lists: Archives: freeciv-ai: November 2002:
[freeciv-ai] Re: patch/rfc: wrap activity
Home

[freeciv-ai] Re: patch/rfc: wrap activity

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: patch/rfc: wrap activity
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Wed, 27 Nov 2002 18:39:17 +0000 (GMT)

On Wed, 27 Nov 2002, Gregory Berkolaiko wrote:
> 1. Only in 1% of the time (if that) it will be called with fortifying
> task. So 99% of the time the check is a CPU waste.

Have you measured it?

> 2. It will not solve the fortification problem.It won't even _help_ to
> solve it.The fortification problem comes from aiunit.c
> 2271 if (punit->activity != ACTIVITY_IDLE)
> 2272   handle_unit_activity_request(punit, ACTIVITY_IDLE);
> and then later
> 2312   } else if (punit->activity == ACTIVITY_IDLE) {
> 2313     handle_unit_activity_request(punit, ACTIVITY_FORTIFYING);
> If the first 2 lines are removed, the last two lines make perfect sense
> and need no wrappers.

Well, of course this is already fixed in massiveai...

> On the other hand, although I am against moving AI to client, there should
> be good separation between AI and the game engine.This wrapper provides
> another layer of this separation.But maybe handle_unit_activity_request
> is enough of a separation?

Probably. I'll make a new patch to move the check into
handle_unit_activity_request and make the rest of the code use it (instead
of set_unit_activity).

  - Per



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