[freeciv-ai] kill_something_with() stupidities
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
ai/advmilitary.c:
/* Consider a land attacker */
unit_type = ai_choose_attacker(pcity, LAND_MOVING);
if (unit_type >= 0) {
assert(can_build_unit(pcity, unit_type));
virtualunit = create_unit_virtual(pplayer, pcity, unit_type, TRUE);
kill_something_with(pplayer, pcity, virtualunit, choice);
destroy_unit_virtual(virtualunit);
}
It looks like the unit we're giving to ksw is the unit we're considering
building. But that is deceptive! ksw does its very own evaluation of which
unit it wants to build, essentially throwing away the result from
ai_choose_attacker(), making the latter essentially redundant. The
evaluation done in ksw is also buggy, allowing forbidden units to be built
by AI, which I discovered after several hours of debugging a non-AI patch.
This is all bad. The same goes for sea attackers.
- Per
- [freeciv-ai] kill_something_with() stupidities,
Per I. Mathisen <=
|
|