diff --git a/src/command.cpp b/src/command.cpp index 4b63357448..7bf1b8cba6 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; +} diff --git a/src/command_type.h b/src/command_type.h index 2f3fe29475..da310fe4ea 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -49,15 +49,7 @@ public: * @param ret the command to add the cost of. * @return this class. */ - CommandCost AddCost(CommandCost ret) - { - this->AddCost(ret.cost); - if (this->success && !ret.success) { - this->message = ret.message; - this->success = false; - } - return *this; - } + CommandCost AddCost(CommandCost ret); /** * Adds the given cost to the cost of the command.