summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-03-14 14:36:37 +0000
committeralberth <alberth@openttd.org>2010-03-14 14:36:37 +0000
commit28b0a3e335701d3fea872590476732487bad3efa (patch)
treeb0b7b48bd9f86bfe0cf8c9f3373d6aab83862dbd /src
parent6601ecc87a81257c022388b02fb03db39de3bd74 (diff)
downloadopenttd-28b0a3e335701d3fea872590476732487bad3efa.tar.xz
(svn r19419) -Codechange: Use failed CommandCost object to retrieve message instead of _error_message.
Diffstat (limited to 'src')
-rw-r--r--src/ai/api/ai_object.cpp2
-rw-r--r--src/bridge_gui.cpp2
-rw-r--r--src/command.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/ai/api/ai_object.cpp b/src/ai/api/ai_object.cpp
index 7282ba927..e137faf1e 100644
--- a/src/ai/api/ai_object.cpp
+++ b/src/ai/api/ai_object.cpp
@@ -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 */
if (res.Failed()) {
res.SetGlobalErrorMessage();
- SetLastError(AIError::StringToError(_error_message));
+ SetLastError(AIError::StringToError(res.GetErrorMessage()));
return false;
}
diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp
index cccfbedde..85b2e7b48 100644
--- a/src/bridge_gui.cpp
+++ b/src/bridge_gui.cpp
@@ -387,7 +387,7 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
GUIBridgeList *bl = NULL;
if (ret.Failed()) {
- errmsg = _error_message;
+ errmsg = ret.GetErrorMessage();
} else {
/* check which bridges can be built */
const uint tot_bridgedata_len = CalcBridgeLenCostFactor(bridge_len + 2);
diff --git a/src/command.cpp b/src/command.cpp
index c716d7970..73d8901c5 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -511,7 +511,7 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac
/* Only show the error when it's for us. */
StringID error_part1 = GB(cmd, 16, 16);
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) {
ShowEstimatedCostOrIncome(res.GetCost(), x, y);