mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 07:30:40 +01:00
Vehicle and driver persistence is now set when a vehicle is collected, inside the CollectedVehicle class.
This commit is contained in:
parent
5a36a3582a
commit
0ad0136c3a
1 changed files with 3 additions and 3 deletions
|
|
@ -255,15 +255,15 @@ namespace SceneManager
|
|||
collectedVehicle.Dismiss();
|
||||
collectedVehicle = null;
|
||||
}
|
||||
VehicleCollector.SetVehicleAndDriverPersistence(nearbyVehicle);
|
||||
//VehicleCollector.SetVehicleAndDriverPersistence(nearbyVehicle);
|
||||
|
||||
// The vehicle should only be added to the collection when it's not null AND if the selected item is First Waypoint OR if the selected item is nearestWaypoint AND nearestWaypoint is not null
|
||||
if (collectedVehicle == null && directOptions.SelectedItem == "First waypoint" || (directOptions.SelectedItem == "Nearest waypoint" && nearestWaypoint != null))
|
||||
{
|
||||
Game.LogTrivial($"[Direct Driver] {nearbyVehicle.Model.Name} not found in collection, adding now.");
|
||||
Game.LogTrivial($"[Direct Driver] Adding {nearbyVehicle.Model.Name} to collection.");
|
||||
VehicleCollector.collectedVehicles.Add(new CollectedVehicle(nearbyVehicle, path));
|
||||
collectedVehicle = VehicleCollector.collectedVehicles.Where(cv => cv.Vehicle == nearbyVehicle).FirstOrDefault();
|
||||
Logger.Log($"Collected vehicle is {collectedVehicle.Vehicle.Model.Name}");
|
||||
//Logger.Log($"Collected vehicle is {collectedVehicle.Vehicle.Model.Name}");
|
||||
}
|
||||
|
||||
if (collectedVehicle == null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue