diff options
author | peter1138 <peter1138@openttd.org> | 2005-12-10 12:05:39 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2005-12-10 12:05:39 +0000 |
commit | 80986fcd3289879cf88a7978f5c1d305b0a48158 (patch) | |
tree | 4ae75b1c93989fadb955dd408fcc2c0589671b22 /ai/trolly | |
parent | 50a1e16943b03a77c908d938eabcf075390e0dff (diff) | |
download | openttd-80986fcd3289879cf88a7978f5c1d305b0a48158.tar.xz |
(svn r3282) - Codechange: Replace tests against CMD_ERROR with CmdFailed()
Diffstat (limited to 'ai/trolly')
-rw-r--r-- | ai/trolly/trolly.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |