|
@@ -8,26 +8,25 @@
|
|
|
/** @file script_waypointlist.cpp Implementation of ScriptWaypointList and friends. */
|
|
|
|
|
|
#include "../../stdafx.h"
|
|
|
#include "script_waypointlist.hpp"
|
|
|
#include "script_vehicle.hpp"
|
|
|
#include "../../vehicle_base.h"
|
|
|
#include "../../waypoint_base.h"
|
|
|
|
|
|
#include "../../safeguards.h"
|
|
|
|
|
|
ScriptWaypointList::ScriptWaypointList(ScriptWaypoint::WaypointType waypoint_type)
|
|
|
{
|
|
|
const Waypoint *wp;
|
|
|
FOR_ALL_WAYPOINTS(wp) {
|
|
|
for (const Waypoint *wp : Waypoint::Iterate()) {
|
|
|
if ((wp->facilities & waypoint_type) &&
|
|
|
(wp->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY || wp->owner == OWNER_NONE)) this->AddItem(wp->index);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
ScriptWaypointList_Vehicle::ScriptWaypointList_Vehicle(VehicleID vehicle_id)
|
|
|
{
|
|
|
if (!ScriptVehicle::IsValidVehicle(vehicle_id)) return;
|
|
|
|
|
|
const Vehicle *v = ::Vehicle::Get(vehicle_id);
|
|
|
|
|
|
for (const Order *o = v->GetFirstOrder(); o != nullptr; o = o->next) {
|