(svn r23624) -Add: ScriptVehicle/ScriptStation/ScriptSign::GetOwner, to get the owner of those objects (GameScript only)
This commit is contained in:
@@ -31,6 +31,13 @@
|
||||
return v != NULL && (v->owner == _current_company || _current_company == OWNER_DEITY) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()));
|
||||
}
|
||||
|
||||
/* static */ ScriptCompany::CompanyID ScriptVehicle::GetOwner(VehicleID vehicle_id)
|
||||
{
|
||||
if (!IsValidVehicle(vehicle_id)) return ScriptCompany::COMPANY_INVALID;
|
||||
|
||||
return static_cast<ScriptCompany::CompanyID>((int)::Vehicle::Get(vehicle_id)->owner);
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptVehicle::GetNumWagons(VehicleID vehicle_id)
|
||||
{
|
||||
if (!IsValidVehicle(vehicle_id)) return -1;
|
||||
|
Reference in New Issue
Block a user