(svn r23624) -Add: ScriptVehicle/ScriptStation/ScriptSign::GetOwner, to get the owner of those objects (GameScript only)

This commit is contained in:
truebrain
2011-12-19 21:00:40 +00:00
parent 3a535690d4
commit d85a628dde
9 changed files with 52 additions and 0 deletions

View File

@@ -26,6 +26,13 @@
return st != NULL && (st->owner == _current_company || _current_company == OWNER_DEITY || st->owner == OWNER_NONE);
}
/* static */ ScriptCompany::CompanyID ScriptStation::GetOwner(StationID station_id)
{
if (!IsValidStation(station_id)) return ScriptCompany::COMPANY_INVALID;
return static_cast<ScriptCompany::CompanyID>((int)::Station::Get(station_id)->owner);
}
/* static */ StationID ScriptStation::GetStationID(TileIndex tile)
{
if (!::IsValidTile(tile) || !::IsTileType(tile, MP_STATION)) return INVALID_STATION;