1
Fork 0
mirror of https://github.com/thegeneralist01/Scene-Manager-DevRepo synced 2026-01-11 23:50: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

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