Complete.Org: Mailing Lists: Archives: freeciv-ai: September 2002:
[freeciv-ai] enemies_at() flip flop
Home

[freeciv-ai] enemies_at() flip flop

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] enemies_at() flip flop
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 24 Sep 2002 22:05:32 +0000 (GMT)

  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



[Prev in Thread] Current Thread [Next in Thread]