1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 15:40:29 +01:00

Updated check when deleting vehicle to include all occupants, not just driver

This commit is contained in:
Rich Dunne 2020-09-22 14:40:24 -06:00
parent c7ef4ab52d
commit 7688768d9b
2 changed files with 10 additions and 10 deletions

View file

@ -303,14 +303,14 @@ namespace SceneManager
else if(dismissDriver.Index == (int)DismissOption.FromWorld)
{
Game.LogTrivial($"Dismissed {nearbyVehicle.Model.Name} from the world");
if (nearbyVehicle.HasDriver)
while (nearbyVehicle.HasOccupants)
{
while (nearbyVehicle.Driver)
foreach (Ped occupant in nearbyVehicle.Occupants)
{
nearbyVehicle.Driver.Dismiss();
nearbyVehicle.Driver.Delete();
GameFiber.Yield();
occupant.Dismiss();
occupant.Delete();
}
GameFiber.Yield();
}
nearbyVehicle.Delete();