mirror of https://github.com/OpenTTD/OpenTTD
Cleanup: [Script] Remove ScriptStation::GetOwner
Due to class inheritance, GSStation::GetOwner and GSWaypoint::GetOwner can both reach GetOwner defined at GSBaseStation.pull/13406/head
parent
bb70dffe70
commit
fe9eae3be7
|
@ -26,13 +26,6 @@
|
|||
return st != nullptr && (st->owner == ScriptObject::GetCompany() || ScriptCompanyMode::IsDeity() || st->owner == OWNER_NONE);
|
||||
}
|
||||
|
||||
/* static */ ScriptCompany::CompanyID ScriptStation::GetOwner(StationID station_id)
|
||||
{
|
||||
if (!IsValidStation(station_id)) return ScriptCompany::COMPANY_INVALID;
|
||||
|
||||
return ScriptCompany::ToScriptCompanyID(::Station::Get(station_id)->owner);
|
||||
}
|
||||
|
||||
/* static */ StationID ScriptStation::GetStationID(TileIndex tile)
|
||||
{
|
||||
if (!::IsValidTile(tile) || !::IsTileType(tile, MP_STATION)) return StationID::Invalid();
|
||||
|
|
|
@ -59,15 +59,6 @@ public:
|
|||
*/
|
||||
static bool IsValidStation(StationID station_id);
|
||||
|
||||
/**
|
||||
* Get the owner of a station.
|
||||
* @param station_id The station to get the owner of.
|
||||
* @pre IsValidStation(station_id).
|
||||
* @return The owner the station has.
|
||||
* @api -ai
|
||||
*/
|
||||
static ScriptCompany::CompanyID GetOwner(StationID station_id);
|
||||
|
||||
/**
|
||||
* Get the StationID of a tile, if there is a station.
|
||||
* @param tile The tile to find the stationID of
|
||||
|
|
Loading…
Reference in New Issue