Complete.Org: Mailing Lists: Archives: freeciv-ai: December 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: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: patch/rfc: wrap activity
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Mon, 2 Dec 2002 19:22:18 +0000 (GMT)

On Sun, 1 Dec 2002, Per I. Mathisen wrote:

> Ok, here is a patch which cleans up could_unit_move_to_tile() and makes
> use of it around the code where applicable (instead of
> can_unit_move_to_tile() which will check with current activity instead of
> ACTIVITY_IDLE).
> 
> Along with a patch to remove direct setting of activities with
> set_unit_activity(), this should be enough low-level change for fortifying
> to work. The rest is high-level and will be the subject of another patch.
> 
> I intend to commit this very soon, since I want to move on to the other
> patches in this series.

Three comments: 

1. could_be_my_zoc is a really dopey function, I am not sure I understand 
it and what it's consequences are...  It would make sense if it was 
checking if the tile we intend to go to is occupied -- that would mean we 
are attacking which is ok.  But I don't think it does that...

2. Raimar would object to your treating returned int as a bool.

3. In
-        if (!can_unit_move_to_tile(punit, x1, y1, FALSE))
+        if (could_unit_move_to_tile(punit, x1, y1)) {
           continue;
+        }
I think you forgot "== 0" in the condition.

G.






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