CommandCost: Add a tile auxiliary field
This commit is contained in:
@@ -1274,3 +1274,13 @@ int CommandCost::WriteSummaryMessage(char *buf, char *last, StringID cmd_msg) co
|
|||||||
return b - buf;
|
return b - buf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CommandCost::SetTile(TileIndex tile)
|
||||||
|
{
|
||||||
|
if (tile == this->GetTile()) return;
|
||||||
|
|
||||||
|
if (!this->aux_data) {
|
||||||
|
this->aux_data.reset(new CommandCostAuxliaryData());
|
||||||
|
}
|
||||||
|
this->aux_data->tile = tile;
|
||||||
|
}
|
||||||
|
@@ -32,6 +32,7 @@ class CommandCost {
|
|||||||
uint32 textref_stack[16] = {};
|
uint32 textref_stack[16] = {};
|
||||||
const GRFFile *textref_stack_grffile = nullptr; ///< NewGRF providing the #TextRefStack content.
|
const GRFFile *textref_stack_grffile = nullptr; ///< NewGRF providing the #TextRefStack content.
|
||||||
uint textref_stack_size = 0; ///< Number of uint32 values to put on the #TextRefStack for the error message.
|
uint textref_stack_size = 0; ///< Number of uint32 values to put on the #TextRefStack for the error message.
|
||||||
|
TileIndex tile = INVALID_TILE;
|
||||||
};
|
};
|
||||||
std::unique_ptr<CommandCostAuxliaryData> aux_data;
|
std::unique_ptr<CommandCostAuxliaryData> aux_data;
|
||||||
|
|
||||||
@@ -225,6 +226,13 @@ public:
|
|||||||
res.success = false;
|
res.success = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TileIndex GetTile() const
|
||||||
|
{
|
||||||
|
return this->aux_data != nullptr ? this->aux_data->tile : INVALID_TILE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SetTile(TileIndex tile);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user