Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2003:
[freeciv-ai] Bug in feryboat
Home

[freeciv-ai] Bug in feryboat

[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] Bug in feryboat
From: Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>
Date: Mon, 28 Apr 2003 18:41:37 +0200

static void ai_manage_ferryboat(struct player *pplayer, struct unit *punit)
{ /* It's about 12 feet square and has a capacity of almost 1000 pounds.
    It is well constructed of teak, and looks seaworthy. */
 struct city *pcity;
 struct city *port = NULL;
 struct unit *bodyguard = NULL;
 struct unit_type *punittype = get_unit_type(punit->type);
 int best = 4 * punittype->move_rate, x = punit->x, y = punit->y;
 int n = 0, p = 0;

 CHECK_UNIT(punit);

if (!unit_list_find(&map_get_tile(punit->x, punit->y)->units, punit->ai.passenger))
   punit->ai.passenger = 0;

 unit_list_iterate(map_get_tile(punit->x, punit->y)->units, aunit)
   if (punit->owner != aunit->owner) {
     return;
   }


This must be a continue; NOT a return!!!!! I've seen many times a transport full of units waiting in my cities without a reason!!! When playing with AIDiplomacy.




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