2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file script_enginelist.cpp Implementation of ScriptEngineList and friends. */
10 #include "../../stdafx.h"
11 #include "script_enginelist.hpp"
12 #include "../../engine_base.h"
14 #include "../../safeguards.h"
16 ScriptEngineList::ScriptEngineList(ScriptVehicle::VehicleType vehicle_type
)
18 EnforceDeityOrCompanyModeValid_Void();
19 bool is_deity
= ScriptCompanyMode::IsDeity();
20 CompanyID owner
= ScriptObject::GetCompany();
21 for (const Engine
*e
: Engine::IterateType((::VehicleType
)vehicle_type
)) {
22 if (is_deity
|| HasBit(e
->company_avail
, owner
)) this->AddItem(e
->index
);