Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: [Patch] Make do_unit_goto return a meaningful value (P
Home

[Freeciv-Dev] Re: [Patch] Make do_unit_goto return a meaningful value (P

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [Patch] Make do_unit_goto return a meaningful value (PR#985)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Tue, 2 Oct 2001 02:34:47 +0100 (BST)

This is updated version of the patch.
I introduced another GOTO result: GR_FOUGHT, it is returned when unit was
fighting and doesn't want to move after that.

The only "serious" change to the code is that I removed is_tiles_adjacent
(what a grammatical structure) check in goto_route_execute
  http://www.freeciv.org/lxr/source/server/unittools.c?v=cvs#L3095
The same check is done in handle_unit_move_request, so nothing is lost
here.  I moved the LOG_DEBUG message there.

The test savegames are still identical.

Best,
G.

 --- Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> wrote: 
> Since do_unit_goto attempts to change the location of a unit and can
> fail/succeed in a number of different ways. This information is later
> extracted indirectly and used by other code, e.g.
>   http://www.freeciv.org/lxr/source/ai/aiunit.c?v=cvs#L234
>   http://www.freeciv.org/lxr/source/ai/aiunit.c?v=cvs#L894
> 
> I think it would be better to have do_unit_goto return a meaningful
> answer.
> 
> Attached patch introduces 
>   enum goto_result 
> and makes do_unit_goto and goto_route_execute return a value of this
> type.
> 
> So far it is not used but I really need it to improve
> ai_manage_explorer.
> 
> The testgames are identical with/without the patch.
> 
> Best,
> G.


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie

Attachment: goto_result2.diff
Description: goto_result2.diff


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