mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40:29 +01:00
Added extension VehicleAndDriverValid
This commit is contained in:
parent
53f0e99b93
commit
d6f5f8ebe3
1 changed files with 14 additions and 0 deletions
|
|
@ -96,5 +96,19 @@ namespace SceneManager.Utils
|
||||||
Game.LogTrivial($"Nothing else has returned true by this point. (non-ambient)");
|
Game.LogTrivial($"Nothing else has returned true by this point. (non-ambient)");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Determines if a vehicle and driver are valid.
|
||||||
|
/// </summary>
|
||||||
|
internal static bool VehicleAndDriverValid(this Vehicle vehicle)
|
||||||
|
{
|
||||||
|
if (vehicle && vehicle.HasDriver && vehicle.Driver && vehicle.Driver.IsAlive)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue