Codechange: use GSCompanyMode::IsValid, IsDeity, and the precondition helpers
Direct 1:1 replacements in the code, and comments now refer to either GSCompanyMode::IsValid or GSCompanyMode::IsDeity instead of several variations on "company mode active" or "no company mode active".
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
/* static */ bool ScriptBaseStation::IsValidBaseStation(StationID station_id)
|
||||
{
|
||||
const BaseStation *st = ::BaseStation::GetIfValid(station_id);
|
||||
return st != nullptr && (st->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY || st->owner == OWNER_NONE);
|
||||
return st != nullptr && (st->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity() || st->owner == OWNER_NONE);
|
||||
}
|
||||
|
||||
/* static */ char *ScriptBaseStation::GetName(StationID station_id)
|
||||
@@ -37,7 +37,7 @@
|
||||
{
|
||||
CCountedPtr<Text> counter(name);
|
||||
|
||||
EnforcePrecondition(false, ScriptObject::GetCompany() != OWNER_DEITY);
|
||||
EnforceCompanyModeValid(false);
|
||||
EnforcePrecondition(false, IsValidBaseStation(station_id));
|
||||
EnforcePrecondition(false, name != nullptr);
|
||||
const std::string &text = name->GetDecodedText();
|
||||
|
Reference in New Issue
Block a user