summaryrefslogtreecommitdiff
path: root/src/command.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-07 20:02:36 +0000
committersmatz <smatz@openttd.org>2008-04-07 20:02:36 +0000
commit42a66ef9903d12cf748ddc6b3c4dcfaaef1c5efd (patch)
treec2115574a47116b76a0611096c82fda037e9a4b4 /src/command.cpp
parentf1cd7ef5ee9d0862622d53a4c348d6f9debd500e (diff)
downloadopenttd-42a66ef9903d12cf748ddc6b3c4dcfaaef1c5efd.tar.xz
(svn r12616) -Codechange: r12591 didn't work as expected for NDS, move one function back to cpp
Diffstat (limited to 'src/command.cpp')
-rw-r--r--src/command.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/command.cpp b/src/command.cpp
index 4b6335744..7bf1b8cba 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -668,3 +668,14 @@ callb_err:
ClearStorageChanges(false);
return false;
}
+
+
+CommandCost CommandCost::AddCost(CommandCost ret)
+{
+ this->AddCost(ret.cost);
+ if (this->success && !ret.success) {
+ this->message = ret.message;
+ this->success = false;
+ }
+ return *this;
+}