From 80986fcd3289879cf88a7978f5c1d305b0a48158 Mon Sep 17 00:00:00 2001 From: peter1138 Date: Sat, 10 Dec 2005 12:05:39 +0000 Subject: (svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed() --- ai/trolly/trolly.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ai/trolly') diff --git a/ai/trolly/trolly.c b/ai/trolly/trolly.c index 2ddd8fb58..a2a0f8a35 100644 --- a/ai/trolly/trolly.c +++ b/ai/trolly/trolly.c @@ -659,7 +659,7 @@ static void AiNew_State_FindStation(Player *p) if (accepts[p->ainew.cargo] >> 3 == 0) continue; // See if we can build the station r = AiNew_Build_Station(p, p->ainew.tbt, new_tile, 0, 0, 0, DC_QUERY_COST); - if (r == CMD_ERROR) continue; + if (CmdFailed(r)) continue; // We can build it, so add it to found_spot found_spot[i] = new_tile; found_best[i++] = accepts[p->ainew.cargo]; @@ -846,7 +846,7 @@ static void AiNew_State_FindDepot(Player *p) if (ti.tileh != 0) continue; // Check if everything went okay.. r = AiNew_Build_Depot(p, tile + TileOffsByDir(j), j ^ 2, 0); - if (r == CMD_ERROR) continue; + if (CmdFailed(r)) continue; // Found a spot! p->ainew.new_cost += r; p->ainew.depot_tile = tile + TileOffsByDir(j); @@ -989,7 +989,7 @@ static void AiNew_State_BuildStation(Player *p) res = AiNew_Build_Station(p, p->ainew.tbt, p->ainew.to_tile, 0, 0, p->ainew.to_direction, DC_EXEC); p->ainew.state = AI_STATE_BUILD_PATH; } - if (res == CMD_ERROR) { + if (CmdFailed(res)) { DEBUG(ai,0)("[AiNew - BuildStation] Strange but true... station can not be build!"); p->ainew.state = AI_STATE_NOTHING; // If the first station _was_ build, destroy it @@ -1119,7 +1119,7 @@ static void AiNew_State_BuildDepot(Player *p) return; res = AiNew_Build_Depot(p, p->ainew.depot_tile, p->ainew.depot_direction, DC_EXEC); - if (res == CMD_ERROR) { + if (CmdFailed(res)) { DEBUG(ai,0)("[AiNew - BuildDepot] Strange but true... depot can not be build!"); p->ainew.state = AI_STATE_NOTHING; return; @@ -1152,7 +1152,7 @@ static void AiNew_State_BuildVehicle(Player *p) // Build the vehicle res = AiNew_Build_Vehicle(p, p->ainew.depot_tile, DC_EXEC); - if (res == CMD_ERROR) { + if (CmdFailed(res)) { // This happens when the AI can't build any more vehicles! p->ainew.state = AI_STATE_NOTHING; return; -- cgit v1.2.3-70-g09d2