Add command result flag for whether SetResultData was called

Use for tracerestrict validation result fail offset
This commit is contained in:
Jonathan G Rennison
2023-05-30 23:29:53 +01:00
parent 5dcbd9271b
commit 13183d3f13
4 changed files with 10 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ enum CommandCostIntlFlags : uint8 {
CCIF_INLINE_EXTRA_MSG = 1 << 1,
CCIF_INLINE_TILE = 1 << 2,
CCIF_INLINE_RESULT = 1 << 3,
CCIF_VALID_RESULT = 1 << 4,
};
DECLARE_ENUM_AS_BIT_SET(CommandCostIntlFlags)
@@ -257,6 +258,11 @@ public:
void SetTile(TileIndex tile);
bool HasResultData() const
{
return (this->flags & CCIF_VALID_RESULT);
}
uint32 GetResultData() const
{
if (this->flags & CCIF_INLINE_RESULT) return this->inl.result;