mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40:29 +01:00
Fixed crash when directing driver to a path
This commit is contained in:
parent
c68ba728e9
commit
d118513185
1 changed files with 1 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ namespace SceneManager.Utils
|
||||||
|
|
||||||
internal static void Direct(Vehicle nearbyVehicle, Path path, Waypoint targetWaypoint)
|
internal static void Direct(Vehicle nearbyVehicle, Path path, Waypoint targetWaypoint)
|
||||||
{
|
{
|
||||||
var nearbyVehiclesPath = PathManager.Paths.FirstOrDefault(p => p.CollectedPeds.Any(v => v.CurrentVehicle == nearbyVehicle));
|
var nearbyVehiclesPath = PathManager.Paths.FirstOrDefault(p => p != null && p.CollectedPeds.Any(v => v.CurrentVehicle == nearbyVehicle));
|
||||||
if(nearbyVehiclesPath == null)
|
if(nearbyVehiclesPath == null)
|
||||||
{
|
{
|
||||||
Game.LogTrivial($"Nearby vehicle does not belong to any path.");
|
Game.LogTrivial($"Nearby vehicle does not belong to any path.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue