[Freeciv-Dev] Re: (PR#4188) get_defender() given illegal combat options
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 7 May 2003, Per I. Mathisen wrote:
>
> ai/aiunit.c, find_something_to_kill():
>
> if (!(aunit == get_defender(punit, aunit->x, aunit->y))) {
> /* It's not the main defender */
> continue;
> }
>
> This can attempt to make a defender in illegal conditions, which in turn
> leads to an assert failure in get_defender().
Failure of which assert? Asserts inget_defender ain't easy to fail...
> One solution is to remove the error checking from get_defender(). I don't
> find that a good idea.
>
> Another is to make a wrapping function for get_defender() for the AI for
> whenever we use it virtually.
>
> But best of all, I think we can just add a call to
> can_unit_attack_unit_at_tile() to the above mess.
this is the best of the three, but I am not sure if there is a need for
any fix at all...
G.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#4188) get_defender() given illegal combat options,
Gregory Berkolaiko <=
|
|