Fix plugin get car entities returning null elements (#11988)

This commit is contained in:
Olivier Wervers 2020-06-18 22:50:06 +02:00 committed by GitHub
parent ab9b8cd57e
commit e280b413c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -148,8 +148,8 @@ namespace OpenRCT2::Scripting
for (auto carId = sprite->sprite_index; carId != SPRITE_INDEX_NULL;)
{
auto car = GetEntity<Vehicle>(carId);
carId = car->next_vehicle_on_train;
result.push_back(GetObjectAsDukValue(_context, std::make_shared<ScVehicle>(carId)));
carId = car->next_vehicle_on_train;
}
}
else