mirror of https://github.com/OpenTTD/OpenTTD
(svn r19419) -Codechange: Use failed CommandCost object to retrieve message instead of _error_message.
parent
6601ecc87a
commit
28b0a3e335
|
@ -215,7 +215,7 @@ bool AIObject::DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint cmd, const c
|
||||||
/* We failed; set the error and bail out */
|
/* We failed; set the error and bail out */
|
||||||
if (res.Failed()) {
|
if (res.Failed()) {
|
||||||
res.SetGlobalErrorMessage();
|
res.SetGlobalErrorMessage();
|
||||||
SetLastError(AIError::StringToError(_error_message));
|
SetLastError(AIError::StringToError(res.GetErrorMessage()));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -387,7 +387,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
||||||
|
|
||||||
GUIBridgeList *bl = NULL;
|
GUIBridgeList *bl = NULL;
|
||||||
if (ret.Failed()) {
|
if (ret.Failed()) {
|
||||||
errmsg = _error_message;
|
errmsg = ret.GetErrorMessage();
|
||||||
} else {
|
} else {
|
||||||
/* check which bridges can be built */
|
/* check which bridges can be built */
|
||||||
const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
|
const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
|
||||||
|
|
|
@ -511,7 +511,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
|
||||||
/* Only show the error when it's for us. */
|
/* Only show the error when it's for us. */
|
||||||
StringID error_part1 = GB(cmd, 16, 16);
|
StringID error_part1 = GB(cmd, 16, 16);
|
||||||
if (estimate_only || (IsLocalCompany() && error_part1 != 0 && my_cmd)) {
|
if (estimate_only || (IsLocalCompany() && error_part1 != 0 && my_cmd)) {
|
||||||
ShowErrorMessage(error_part1, _error_message, WL_INFO, x, y);
|
ShowErrorMessage(error_part1, res.GetErrorMessage(), WL_INFO, x, y);
|
||||||
}
|
}
|
||||||
} else if (estimate_only) {
|
} else if (estimate_only) {
|
||||||
ShowEstimatedCostOrIncome(res.GetCost(), x, y);
|
ShowEstimatedCostOrIncome(res.GetCost(), x, y);
|
||||||
|
|
Loading…
Reference in New Issue