[Freeciv-Dev] (PR#4188) get_defender() given illegal combat options
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients:; |
Subject: |
[Freeciv-Dev] (PR#4188) get_defender() given illegal combat options |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Wed, 7 May 2003 13:32:03 -0700 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
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().
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.
Greg? You touched this code last.
- Per
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] (PR#4188) get_defender() given illegal combat options,
Per I. Mathisen <=
|
|