* 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. */
| 399 | * @param ret The command to add the cost of. |
| 400 | */ |
| 401 | void CommandCost::AddCost(CommandCost &&ret) |
| 402 | { |
| 403 | this->AddCost(ret.cost); |
| 404 | if (this->success && !ret.success) { |
| 405 | this->message = ret.message; |
| 406 | this->encoded_message = std::move(ret.encoded_message); |
| 407 | this->success = false; |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * Return an error status, with string and parameter. |
no outgoing calls