Changeset - r23776:7f621ff1807f
[Not reviewed]
master
0 1 0
unknown - 5 years ago 2019-06-05 14:32:32
kruijsse@usc.edu
Fix #5685: Check for free wagons in ScriptVehicleList
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/script/api/script_vehiclelist.cpp
Show inline comments
 
@@ -16,6 +16,7 @@
 
#include "script_station.hpp"
 
#include "../../depot_map.h"
 
#include "../../vehicle_base.h"
 
#include "../../train.h"
 

	
 
#include "../../safeguards.h"
 

	
 
@@ -23,7 +24,7 @@ ScriptVehicleList::ScriptVehicleList()
 
{
 
	const Vehicle *v;
 
	FOR_ALL_VEHICLES(v) {
 
		if ((v->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY) && v->IsPrimaryVehicle()) this->AddItem(v->index);
 
		if ((v->owner == ScriptObject::GetCompany() || ScriptObject::GetCompany() == OWNER_DEITY) && (v->IsPrimaryVehicle() || (v->type == VEH_TRAIN && ::Train::From(v)->IsFreeWagon()))) this->AddItem(v->index);
 
	}
 
}
 

	
0 comments (0 inline, 0 general)