Re: (PR#11066) Units that cannot be obsoleted trigger assert for AI
"Jason Short" <[email protected]> Wed, 17 Nov 2004 22:16:38 -0800
| Newsgroups | gmane.games.freeciv.ai |
|---|---|
| Message-ID | <[email protected]> |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=11066 > Gregory Berkolaiko wrote: > <URL: http://rt.freeciv.org/Ticket/Display.html?id=11066 > > > In advmilitary.c: > 819 !can_build_unit_direct(pcity, unit_types[unit_type].obsoleted_by)) > > But obsoleted_by can be -1 (meaning nobody obsoletes it). But > can_build_unit functions have just been made more strict, which causes > and assert. > > I attach a patch but would rather have can_build_unit_* changed to the > previous behaviour -- if a looney type is supplied, the answer is of > course FALSE. Eventually all the -1 should be replaced with U_LAST, or #define U_NONE U_LAST jason