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

Added check for driver's current vehicle when releasing from Stop waypoint in case the ped is not in a vehicle.

This commit is contained in:
Rich Dunne 2020-10-23 06:22:52 -06:00
parent 9ff7aabd9f
commit 0af97e2b2d

View file

@ -75,8 +75,11 @@ namespace SceneManager
//Logger.Log($"Unstucking {Vehicle.Model.Name}"); //Logger.Log($"Unstucking {Vehicle.Model.Name}");
StoppedAtWaypoint = false; StoppedAtWaypoint = false;
Rage.Native.NativeFunction.Natives.x260BE8F09E326A20(Vehicle, 0f, 1, true); Rage.Native.NativeFunction.Natives.x260BE8F09E326A20(Vehicle, 0f, 1, true);
if (Driver.CurrentVehicle)
{
Driver.Tasks.CruiseWithVehicle(5f); Driver.Tasks.CruiseWithVehicle(5f);
} }
}
Driver.Tasks.Clear(); Driver.Tasks.Clear();
if (dismissOption == DismissOption.FromWaypoint) if (dismissOption == DismissOption.FromWaypoint)
@ -113,11 +116,11 @@ namespace SceneManager
{ {
if (CurrentWaypoint == null || Path == null) if (CurrentWaypoint == null || Path == null)
{ {
Logger.Log($"CurrentWaypoint or Path are null"); Game.LogTrivial($"CurrentWaypoint or Path are null");
} }
else if (CurrentWaypoint?.Number != Path?.Waypoints.Count) else if (CurrentWaypoint?.Number != Path?.Waypoints.Count)
{ {
Logger.Log($"Dismissed from waypoint."); Game.LogTrivial($"Dismissed from waypoint.");
SkipWaypoint = true; SkipWaypoint = true;
} }
else if (CurrentWaypoint?.Number == Path?.Waypoints.Count) else if (CurrentWaypoint?.Number == Path?.Waypoints.Count)
@ -128,7 +131,7 @@ namespace SceneManager
void DismissFromPath() void DismissFromPath()
{ {
Logger.Log($"Dismissing from path"); Game.LogTrivial($"Dismissing from path");
Dismissed = true; Dismissed = true;
// Check if the vehicle is near any of the path's collector waypoints // Check if the vehicle is near any of the path's collector waypoints
@ -146,7 +149,7 @@ namespace SceneManager
} }
else else
{ {
Logger.Log($"Nearest collector is null"); Game.LogTrivial($"Nearest collector is null");
} }
if (!Vehicle || !Driver) if (!Vehicle || !Driver)
@ -157,7 +160,7 @@ namespace SceneManager
if (!Directed) if (!Directed)
{ {
Path.CollectedVehicles.Remove(this); Path.CollectedVehicles.Remove(this);
Logger.Log($"{Vehicle.Model.Name} dismissed successfully."); Game.LogTrivial($"{Vehicle.Model.Name} dismissed successfully.");
if (Driver) if (Driver)
{ {
if (Driver.GetAttachedBlip()) if (Driver.GetAttachedBlip())