summaryrefslogtreecommitdiff
path: root/src/ai/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api')
-rw-r--r--src/ai/api/ai_object.cpp2
-rw-r--r--src/ai/api/ai_vehicle.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp
index eb9e247e7..7282ba927 100644
--- a/src/ai/api/ai_object.cpp
+++ b/src/ai/api/ai_object.cpp
@@ -213,7 +213,7 @@ bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const c
CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, _networking ? CcAI : NULL, text, false, estimate_only);
/* We failed; set the error and bail out */
- if (::CmdFailed(res)) {
+ if (res.Failed()) {
res.SetGlobalErrorMessage();
SetLastError(AIError::StringToError(_error_message));
return false;
diff --git a/src/ai/api/ai_vehicle.cpp b/src/ai/api/ai_vehicle.cpp
index 6784ee4b8..123e2f1dd 100644
--- a/src/ai/api/ai_vehicle.cpp
+++ b/src/ai/api/ai_vehicle.cpp
@@ -121,7 +121,7 @@
if (!AICargo::IsValidCargo(cargo)) return -1;
CommandCost res = ::DoCommand(0, vehicle_id, cargo, DC_QUERY_COST, GetCmdRefitVeh(::Vehicle::Get(vehicle_id)));
- return CmdSucceeded(res) ? _returned_refit_capacity : -1;
+ return res.Succeeded() ? _returned_refit_capacity : -1;
}
/* static */ bool AIVehicle::RefitVehicle(VehicleID vehicle_id, CargoID cargo)