Change CommandCost success bool to a flags field

This commit is contained in:
Jonathan G Rennison
2022-12-02 23:01:33 +00:00
parent c777c43be2
commit 523cf75a7a
2 changed files with 25 additions and 19 deletions

View File

@@ -1216,7 +1216,7 @@ CommandCost &CommandCost::operator=(const CommandCost &other)
{
this->cost = other.cost;
this->expense_type = other.expense_type;
this->success = other.success;
this->flags = other.flags;
this->message = other.message;
this->extra_message = other.extra_message;
if (other.aux_data) {
@@ -1233,9 +1233,9 @@ CommandCost &CommandCost::operator=(const CommandCost &other)
void CommandCost::AddCost(const CommandCost &ret)
{
this->AddCost(ret.cost);
if (this->success && !ret.success) {
if (this->Succeeded() && !ret.Succeeded()) {
this->message = ret.message;
this->success = false;
this->flags &= ~CCIF_SUCCESS;
}
}