1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Split Entity Lists by Entity type (#14326)

* Make initial changes to add entity type

* Make further corrections

* Revert header changes

* Fix mistakes
This commit is contained in:
Duncan
2021-03-16 11:18:06 +00:00
committed by GitHub
parent 96524e2b4a
commit 6ec379cd0e
37 changed files with 401 additions and 238 deletions

View File

@@ -21,6 +21,7 @@
#include "object/ObjectManager.h"
#include "object/ObjectRepository.h"
#include "ride/RideData.h"
#include "ride/TrainManager.h"
#include "ride/Vehicle.h"
#include "scenario/Scenario.h"
#include "windows/Intent.h"
@@ -202,7 +203,7 @@ void setup_in_use_selection_flags()
}
// Apply selected object status for hacked vehicles that may not have an associated ride
for (auto vehicle : EntityList<Vehicle>(EntityListId::TrainHead))
for (auto* vehicle : TrainManager::View())
{
ObjectEntryIndex type = vehicle->ride_subtype;
if (type != RIDE_ENTRY_INDEX_NULL) // cable lifts use index null. Ignore them
@@ -210,7 +211,7 @@ void setup_in_use_selection_flags()
Editor::SetSelectedObject(ObjectType::Ride, type, OBJECT_SELECTION_FLAG_SELECTED);
}
}
for (auto vehicle : EntityList<Vehicle>(EntityListId::Vehicle))
for (auto vehicle : EntityList<Vehicle>())
{
ObjectEntryIndex type = vehicle->ride_subtype;
if (type != RIDE_ENTRY_INDEX_NULL) // cable lifts use index null. Ignore them