Codechange: make CompanyMask a BaseBitSet implementation

This commit is contained in:
Rubidium
2025-02-08 10:08:36 +01:00
committed by rubidium42
parent e972033e11
commit ec492cb267
27 changed files with 116 additions and 99 deletions

View File

@@ -214,7 +214,7 @@
EnforceCompanyModeValid(false);
if (!IsValidTown(town_id)) return false;
return ::HasBit(::Town::Get(town_id)->statues, ScriptObject::GetCompany());
return ::Town::Get(town_id)->statues.Test(ScriptObject::GetCompany());
}
/* static */ bool ScriptTown::IsCity(TownID town_id)
@@ -319,7 +319,7 @@
::CompanyID c = ScriptCompany::FromScriptCompanyID(company);
const Town *t = ::Town::Get(town_id);
if (!HasBit(t->have_ratings, c)) {
if (!t->have_ratings.Test(c)) {
return TOWN_RATING_NONE;
} else if (t->ratings[c] <= RATING_APPALLING) {
return TOWN_RATING_APPALLING;