Complete.Org: Mailing Lists: Archives: freeciv-ai: August 2003:
[freeciv-ai] Possible bug in ai_military_gothere

[freeciv-ai] Possible bug in ai_military_gothere

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv AI List <freeciv-ai@xxxxxxxxxxx>
Subject: [freeciv-ai] Possible bug in ai_military_gothere
From: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>
Date: Thu, 28 Aug 2003 18:58:27 +0200

Hi, while looking at the code to try to resolve the problem reported in the previous message i found it.

   Do you remember to say very often barbarian galleons not disembarking?

   In ai_military_attack():

find_something_to_kill(pplayer, punit, &dest_x, &dest_y); ->find objective inland

then we call int i = ai_military_gothere(pplayer, punit, dest_x, dest_y);

   and in ai_military_gothere the disembark check is:

if (goto_is_sane(punit, dest_x, dest_y, TRUE) && punit->moves_left > 0 &&
      (!ferryboat ||
      (real_map_distance(punit->x, punit->y, dest_x, dest_y) < 3 &&
(punit->ai.bodyguard == BODYGUARD_NONE || unit_list_find(&(map_get_tile(punit->x,
      punit->y)->units), punit->ai.bodyguard) || (dcity &&
      !has_defense(dcity)))))) {

So, if the city is inland at 5 tiles of the coast the barbarians or the AI will not disembarc troups.

PS: Also note that behaviour in ai_military_gothere. dest_x and dest_y are used to point at the disembark point and the objective tile.

[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] Possible bug in ai_military_gothere, Jordi Negrevernis i Font <=