MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ScriptVehicleList

Method ScriptVehicleList

src/script/api/script_vehiclelist.cpp:23–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21#include "../../safeguards.h"
22
23ScriptVehicleList::ScriptVehicleList(HSQUIRRELVM vm)
24{
25 EnforceDeityOrCompanyModeValid_Void();
26
27 bool is_deity = ScriptCompanyMode::IsDeity();
28 ::CompanyID owner = ScriptObject::GetCompany();
29
30 ScriptList::FillList<Vehicle>(vm, this,
31 [is_deity, owner](const Vehicle *v) {
32 return (is_deity || v->owner == owner) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()));
33 }
34 );
35}
36
37ScriptVehicleList_Station::ScriptVehicleList_Station(HSQUIRRELVM vm)
38{

Callers

nothing calls this directly

Calls 2

IsFreeWagonMethod · 0.80
IsPrimaryVehicleMethod · 0.45

Tested by

no test coverage detected