Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2002:
[freeciv-ai] Re: ai move cleanup #4
Home

[freeciv-ai] Re: ai move cleanup #4

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: Freeciv AI development <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Re: ai move cleanup #4
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>
Date: Thu, 8 Aug 2002 17:55:49 +0100 (BST)

On Thu, 8 Aug 2002, Per I. Mathisen wrote:

> On Thu, 8 Aug 2002, Gregory Berkolaiko wrote:
> > > (Interestingly, if I read the code right, a unit with move == 0 can still
> > > attack. Is this correct or a misreading or a bug? Seems the client stops
> > > it from happening, but a modified client should be able to do it.)
> >
> > Where did you find it?That'd be very strange.
> 
> More like a lack of finding the necessary check to stop it from happening.
> Read the code from entry at handle_move_unit (sp?) to
> handle_unit_move_request to handle_unit_attack_request. The first check I
> found for move points is where we determine if we can enter the presumably
> emptied position where the enemy used to be.

In handle_unit_move_request:

950     if (punit->moves_left<=0)  {
951       notify_player_ex(pplayer, punit->x, punit->y, E_NOEVENT,
952                        _("Game: This unit has no moves left."));
953       return FALSE;
954     }

> > Just a moment.The above code is for the humans!  It should stay IMO.
> 
> Ooops. Seems I got carried away :)
> 
> The comment should go, though.

yes.

G.



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