[Freeciv-Dev] (PR#6931) Returning GR_FAILED in execute_orders doesn't ca
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6931 >
> [i-freeciv-lists@xxxxxxxxxxxxx - Sun Jan 25 07:59:16 2004]:
>
> On Sat, Jan 24, 2004 at 10:56:35PM -0800, Jason Short wrote:
> >
> > <URL: http://rt.freeciv.org/Ticket/Display.html?id=6931 >
> >
> > > [ali - Sun Nov 23 16:25:51 2003]:
> > >
> > > Bug: maybe_cancel_goto_due_to_enemy() should idle the unit,
> > > like in maybe_cancel_patrol_due_to_enemy().
> > >
> > > Otherwise, unit retains the goto state when a non-attackable unit
> > > unexpectedly exists on a waypoint (only when using waypoint).
> >
> > The goto (now orders) returns GR_FAILED. If this happens then the goto
> > should be canceled; the unit will be left in idle. It looks like the
> > goto/orders function expects the caller to do this, but of course the
> > caller doesn't.
> >
> > Execute_orders should just return a bool indicating whether the unit
> > survives. Any other handling should be done within the function.
> > Perhaps a wrapper function would be helpful (to handle the different
> > return values). If not then the GR_*** enumeration can just be dropped.
>
> I'm for the wrapper. Else the functions grow too much.
I think a wrapper is overkill. But we may have a sub-function or
sub-macro to do the free + notify line.
jason
|
|