From 4c0658e74d228f7c0ba7f278f816645f88fe9377 Mon Sep 17 00:00:00 2001 From: will258012 Date: Thu, 4 Apr 2024 14:19:45 +0800 Subject: [PATCH] Fix Bug Fix the issue where the FPSCamera does not automatically exit when the vehicle disappears (Asu4ni/CitiesSkylines-FPSCamera#54) --- CSkyL | 2 +- FPSCamera/Cam/VehicleCam.cs | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CSkyL b/CSkyL index 403f82c..5a423ac 160000 --- a/CSkyL +++ b/CSkyL @@ -1 +1 @@ -Subproject commit 403f82c2d776f5d9a09342a5352f5af414195da0 +Subproject commit 5a423ac27231680200c910a21281e6a82bb35e21 diff --git a/FPSCamera/Cam/VehicleCam.cs b/FPSCamera/Cam/VehicleCam.cs index aedf722..3366499 100644 --- a/FPSCamera/Cam/VehicleCam.cs +++ b/FPSCamera/Cam/VehicleCam.cs @@ -33,6 +33,15 @@ public override bool Validate() if (Config.G.StickToFrontVehicle && !_SwitchTarget(_target.GetFrontVehicleID())) return false; } + + + if (!_target.IsSpawned) { + if (_target.IsExporting || _target.IsImporting) { + return _target.IsGoingBack; + } + return false; + } + return true; }