Untitled diff
47 líneas
public void SimulationUpdate()
public void SimulationUpdate()
	{
	{
		this.RefreshCarCrashDataAfterLoad();
		this.RefreshCarCrashDataAfterLoad();
		if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track)
		if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track)
		{
		{
			this.ApplyQueueOrders();
			this.ApplyQueueOrders();
		}
		}
		if (this.mTargetPointSteeringBehaviour == null)
		if (this.mTargetPointSteeringBehaviour == null)
		{
		{
			this.mTargetPointSteeringBehaviour = this.mVehicle.steeringManager.GetBehaviour<TargetPointSteeringBehaviour>();
			this.mTargetPointSteeringBehaviour = this.mVehicle.steeringManager.GetBehaviour<TargetPointSteeringBehaviour>();
		}
		}
		switch (this.mStatus)
		switch (this.mStatus)
		{
		{
		case SessionStrategy.Status.NoActionRequired:
		case SessionStrategy.Status.NoActionRequired:
		{
		{
			SessionDetails.SessionType sessionType = Game.instance.sessionManager.eventDetails.currentSession.sessionType;
			SessionDetails.SessionType sessionType = Game.instance.sessionManager.eventDetails.currentSession.sessionType;
			if (sessionType != SessionDetails.SessionType.Race && this.mVehicle.isPlayerDriver && !Game.instance.sessionManager.isUsingAIForPlayerDrivers && (this.mVehicle.performance.fuel.IsOutOfFuel() || this.HasCompletedOrderedLapCount()))
			if (sessionType != SessionDetails.SessionType.Race && this.mVehicle.isPlayerDriver && !Game.instance.sessionManager.isUsingAIForPitting && (this.mVehicle.performance.fuel.IsOutOfFuel() || this.HasCompletedOrderedLapCount()))
			{
			{
				this.mVehicle.strategy.ReturnToGarage();
				this.mVehicle.strategy.ReturnToGarage();
			}
			}
			if (this.mVehicle.timer.hasSeenChequeredFlag)
			if (this.mVehicle.timer.hasSeenChequeredFlag)
			{
			{
				this.mVehicle.strategy.ReturnToGarage();
				this.mVehicle.strategy.ReturnToGarage();
			}
			}
			break;
			break;
		}
		}
		case SessionStrategy.Status.Pitting:
		case SessionStrategy.Status.Pitting:
			if (Game.instance.sessionManager.flag == SessionManager.Flag.Chequered)
			if (Game.instance.sessionManager.flag == SessionManager.Flag.Chequered)
			{
			{
				this.CancelPit();
				this.CancelPit();
			}
			}
			if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track && this.mTargetPointSteeringBehaviour.state == TargetPointSteeringBehaviour.State.None)
			if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track && this.mTargetPointSteeringBehaviour.state == TargetPointSteeringBehaviour.State.None)
			{
			{
				this.mTargetPointSteeringBehaviour.SetTargetPath(PathController.PathType.PitlaneEntry, true);
				this.mTargetPointSteeringBehaviour.SetTargetPath(PathController.PathType.PitlaneEntry, true);
			}
			}
			break;
			break;
		case SessionStrategy.Status.WaitingForSetupCompletion:
		case SessionStrategy.Status.WaitingForSetupCompletion:
			this.WaitForSetupCompletion();
			this.WaitForSetupCompletion();
			break;
			break;
		case SessionStrategy.Status.PitThruPenalty:
		case SessionStrategy.Status.PitThruPenalty:
			if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track && this.mTargetPointSteeringBehaviour.state == TargetPointSteeringBehaviour.State.None)
			if (this.mVehicle.pathController.currentPathType == PathController.PathType.Track && this.mTargetPointSteeringBehaviour.state == TargetPointSteeringBehaviour.State.None)
			{
			{
				this.mTargetPointSteeringBehaviour.SetTargetPath(PathController.PathType.PitlaneEntry, true);
				this.mTargetPointSteeringBehaviour.SetTargetPath(PathController.PathType.PitlaneEntry, true);
			}
			}
			break;
			break;
		}
		}
	}
	}