diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp --- a/src/ai/api/ai_object.cpp +++ b/src/ai/api/ai_object.cpp @@ -213,7 +213,7 @@ bool AIObject::DoCommand(TileIndex tile, 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;