mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Set default values for optional constructor parameters. Added null check to UpdateDrivingFlag method
This commit is contained in:
parent
64587347d7
commit
fb433612a3
1 changed files with 3 additions and 3 deletions
|
|
@ -20,7 +20,7 @@ namespace SceneManager
|
||||||
internal bool EnableWaypointMarker { get; set; } = true;
|
internal bool EnableWaypointMarker { get; set; } = true;
|
||||||
internal bool EnableEditMarker { get; set; }
|
internal bool EnableEditMarker { get; set; }
|
||||||
|
|
||||||
internal Waypoint(Path path, int waypointNum, Vector3 waypointPos, float speed, VehicleDrivingFlags drivingFlag, Blip waypointBlip, bool collector = false, float collectorRadius = 0, float speedZoneRadius = 0)
|
internal Waypoint(Path path, int waypointNum, Vector3 waypointPos, float speed, VehicleDrivingFlags drivingFlag, Blip waypointBlip, bool collector = false, float collectorRadius = 1, float speedZoneRadius = 5)
|
||||||
{
|
{
|
||||||
Path = path;
|
Path = path;
|
||||||
Number = waypointNum;
|
Number = waypointNum;
|
||||||
|
|
@ -61,10 +61,10 @@ namespace SceneManager
|
||||||
{
|
{
|
||||||
if(DrivingFlag == VehicleDrivingFlags.StopAtDestination && newDrivingFlag != VehicleDrivingFlags.StopAtDestination)
|
if(DrivingFlag == VehicleDrivingFlags.StopAtDestination && newDrivingFlag != VehicleDrivingFlags.StopAtDestination)
|
||||||
{
|
{
|
||||||
foreach(CollectedVehicle cv in VehicleCollector.collectedVehicles.Where(cv => cv.Path == Path && cv.CurrentWaypoint == this && cv.StoppedAtWaypoint))
|
foreach(CollectedVehicle cv in VehicleCollector.collectedVehicles.Where(cv => cv.Vehicle && cv.Path == Path && cv.CurrentWaypoint == this && cv.StoppedAtWaypoint))
|
||||||
{
|
{
|
||||||
Logger.Log($"Setting StoppedAtWaypoint to false for {cv.Vehicle.Model.Name}");
|
Logger.Log($"Setting StoppedAtWaypoint to false for {cv.Vehicle.Model.Name}");
|
||||||
cv.StoppedAtWaypoint = false;
|
cv.Dismiss(DismissOption.FromWaypoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DrivingFlag = newDrivingFlag;
|
DrivingFlag = newDrivingFlag;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue