1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 20:54:08 +01:00

Codechange: Use EnumBitSet for GroupFlags.

This commit is contained in:
Peter Nelson
2025-01-29 17:47:50 +00:00
committed by Peter Nelson
parent 4b573b2703
commit 5ef495da78
9 changed files with 25 additions and 26 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::ReplaceProtection, enable, false);
return ScriptObject::Command<CMD_SET_GROUP_FLAG>::Do(group_id, GroupFlag::ReplaceProtection, enable, false);
}
/* static */ bool ScriptGroup::GetAutoReplaceProtection(GroupID group_id)
{
if (!IsValidGroup(group_id)) return false;
return HasFlag(::Group::Get(group_id)->flags, GroupFlags::ReplaceProtection);
return ::Group::Get(group_id)->flags.Test(GroupFlag::ReplaceProtection);
}
/* static */ SQInteger ScriptGroup::GetNumEngines(GroupID group_id, EngineID engine_id)