mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40:29 +01:00
Fixed typo in valid vehicle check
This commit is contained in:
parent
c8874a5186
commit
0be10cb0ef
1 changed files with 3 additions and 2 deletions
|
|
@ -79,7 +79,7 @@ namespace SceneManager
|
||||||
|
|
||||||
private static Vehicle[] GetNearbyVehicles(Vector3 collectorPosition, float radius)
|
private static Vehicle[] GetNearbyVehicles(Vector3 collectorPosition, float radius)
|
||||||
{
|
{
|
||||||
return (from v in World.GetAllVehicles() where v.IsValidForCollection() && v.DistanceTo(collectorPosition) <= radius select v).ToArray();
|
return (from v in World.GetAllVehicles() where v.IsValidForCollection() && v.DistanceTo(collectorPosition) <= radius select v).ToArray(); //v.IsValidForCollection()
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AssignStopForVehiclesFlag(List<Path> paths, Path path, Waypoint waypointData)
|
private static void AssignStopForVehiclesFlag(List<Path> paths, Path path, Waypoint waypointData)
|
||||||
|
|
@ -121,7 +121,7 @@ namespace SceneManager
|
||||||
|
|
||||||
private static bool IsValidForCollection(this Vehicle v)
|
private static bool IsValidForCollection(this Vehicle v)
|
||||||
{
|
{
|
||||||
if(v && v.Speed > 0 && v.IsOnAllWheels && !v != Game.LocalPlayer.Character.CurrentVehicle && (v.IsCar || v.IsBike || v.IsBicycle || v.IsQuadBike || (v.HasSiren && !v.IsSirenOn)))
|
if(v && v.Speed > 0 && v.IsOnAllWheels && v != Game.LocalPlayer.Character.CurrentVehicle && (v.IsCar || v.IsBike || v.IsBicycle || v.IsQuadBike || (v.HasSiren && !v.IsSirenOn)) && !collectedVehicles.ContainsKey(v.LicensePlate))
|
||||||
{
|
{
|
||||||
if(v.HasDriver && !v.Driver.IsAlive)
|
if(v.HasDriver && !v.Driver.IsAlive)
|
||||||
{
|
{
|
||||||
|
|
@ -132,6 +132,7 @@ namespace SceneManager
|
||||||
v.CreateRandomDriver();
|
v.CreateRandomDriver();
|
||||||
v.Driver.IsPersistent = true;
|
v.Driver.IsPersistent = true;
|
||||||
v.Driver.BlockPermanentEvents = true;
|
v.Driver.BlockPermanentEvents = true;
|
||||||
|
Game.LogTrivial($"A missing driver was created for {v.Model.Name}");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue