diff options
author | alberth <alberth@openttd.org> | 2010-02-14 15:30:08 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-02-14 15:30:08 +0000 |
commit | e8d40d6a1987220137e386b1f505947de8d8b514 (patch) | |
tree | 34a4e0fcda875f6d15626f8a53de434d90278c56 /src/command.cpp | |
parent | 151babee57709529e8db2a3871abc4bf66feb1ec (diff) | |
download | openttd-e8d40d6a1987220137e386b1f505947de8d8b514.tar.xz |
(svn r19128) -Codechange: CommandCost cost methods return void instead of a copy of *this.
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/command.cpp b/src/command.cpp index 3a20b7e82..1e422a777 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -682,12 +682,16 @@ CommandCost DoCommandPInternal(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, #undef return_dcpi -CommandCost CommandCost::AddCost(CommandCost ret) +/** + * Adds the cost of the given command return value to this cost. + * Also takes a possible error message when it is set. + * @param ret The command to add the cost of. + */ +void CommandCost::AddCost(CommandCost ret) { this->AddCost(ret.cost); if (this->success && !ret.success) { this->message = ret.message; this->success = false; } - return *this; } |