Change: [Script] Move GSStation::GetOwner to GSBaseStation::GetOwner (#13406)
* Add: [Script] GSBaseStation::GetOwner Added method for Game Scripts to retrieve the owner of a basestation. * Cleanup: [Script] Remove ScriptStation::GetOwner Due to class inheritance, GSStation::GetOwner and GSWaypoint::GetOwner can both reach GetOwner defined at GSBaseStation.
This commit is contained in:
@@ -28,6 +28,12 @@
|
||||
return st != nullptr && (st->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity() || st->owner == OWNER_NONE);
|
||||
}
|
||||
|
||||
/* static */ ScriptCompany::CompanyID ScriptBaseStation::GetOwner(StationID station_id)
|
||||
{
|
||||
if (!IsValidBaseStation(station_id)) return ScriptCompany::COMPANY_INVALID;
|
||||
return ScriptCompany::ToScriptCompanyID(::BaseStation::Get(station_id)->owner);
|
||||
}
|
||||
|
||||
/* static */ std::optional<std::string> ScriptBaseStation::GetName(StationID station_id)
|
||||
{
|
||||
if (!IsValidBaseStation(station_id)) return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user