1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-22 03:42:41 +01:00

Codechange: Make GroupFlags an enum class. (#13312)

GF_END is 'reserved' in some Windows APIs. Instead of working around it, make GroupFlags an enum class.
This commit is contained in:
Peter Nelson
2025-01-14 11:33:26 +00:00
committed by GitHub
parent 29129e12fd
commit 95f8fc983b
9 changed files with 23 additions and 23 deletions

View File

@@ -98,14 +98,14 @@
EnforceCompanyModeValid(false);
EnforcePrecondition(false, IsValidGroup(group_id));
return ScriptObject::Command<CMD_SET_GROUP_FLAG>::Do(group_id, GroupFlags::GF_REPLACE_PROTECTION, enable, false);
return ScriptObject::Command<CMD_SET_GROUP_FLAG>::Do(group_id, GroupFlags::ReplaceProtection, enable, false);
}
/* static */ bool ScriptGroup::GetAutoReplaceProtection(GroupID group_id)
{
if (!IsValidGroup(group_id)) return false;
return HasBit(::Group::Get(group_id)->flags, GroupFlags::GF_REPLACE_PROTECTION);
return HasFlag(::Group::Get(group_id)->flags, GroupFlags::ReplaceProtection);
}
/* static */ SQInteger ScriptGroup::GetNumEngines(GroupID group_id, EngineID engine_id)