[freeciv-ai] enemies_at() flip flop
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
adjc_iterate(x, y, x1, y1) {
if (!pplayer->ai.control
&& !map_get_known_and_seen(x1, y1, unit_owner(punit))) {
continue;
}
> if (is_enemy_city_tile(map_get_tile(x1, y1), unit_owner(punit)))
> return TRUE;
unit_list_iterate(map_get_tile(x1, y1)->units, enemy) {
if (pplayers_at_war(unit_owner(enemy), unit_owner(punit)) &&
can_unit_attack_unit_at_tile(enemy, punit, x, y)) {
a += unit_belligerence_basic(enemy);
if ((a * a * 10) >= d) return TRUE;
}
} unit_list_iterate_end;
} adjc_iterate_end;
Take a look at the lines denoted > above. They cause unnecessary waiting,
and in one case I've seen, also flip flop goto behaviour. A unit
invulnerable to anything in the city shouldn't wait, in particular not sea
or air units. I want to remove it.
Yours
Per
"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra
- [freeciv-ai] enemies_at() flip flop,
Per I. Mathisen <=
|
|