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

Added new Drive-To mode (Direct) which allows the AI to drive on the wrong side of the road to the next waypoint.

This commit is contained in:
Rich Dunne 2020-09-06 22:09:02 -06:00
parent 36a04f94c7
commit a816967255
5 changed files with 22 additions and 6 deletions

View file

@ -71,6 +71,14 @@ namespace SceneManager
void UpdateDrivingFlag(VehicleDrivingFlags newDrivingFlag)
{
if(_drivingFlag == VehicleDrivingFlags.StopAtDestination && newDrivingFlag != VehicleDrivingFlags.StopAtDestination)
{
foreach(CollectedVehicle cv in VehicleCollector.collectedVehicles.Where(cv => cv.Path == _path && cv.CurrentWaypoint == _number && cv.StoppedAtWaypoint))
{
Game.LogTrivial($"Setting StoppedAtWaypoint to false for {cv.Vehicle.Model.Name}");
cv.SetStoppedAtWaypoint(false);
}
}
_drivingFlag = newDrivingFlag;
if (newDrivingFlag == VehicleDrivingFlags.StopAtDestination)
{