From 687bbb463884a969049cc51435b393793ad08d22 Mon Sep 17 00:00:00 2001 From: Clayel Date: Fri, 27 Feb 2026 19:08:22 -0500 Subject: [PATCH 1/4] add launchSite null check, add additional logs --- src/Core/LaunchSites/LaunchSiteChecks.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Core/LaunchSites/LaunchSiteChecks.cs b/src/Core/LaunchSites/LaunchSiteChecks.cs index 1607276..9001423 100644 --- a/src/Core/LaunchSites/LaunchSiteChecks.cs +++ b/src/Core/LaunchSites/LaunchSiteChecks.cs @@ -375,6 +375,11 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit { return true; } + else if (launchSite == null) + { + Log.Normal($"Launchsite is null, cannot find vessel ({vessel?.vesselName}) at Squad launchsite"); + return false; + } } if (vessel.orbitSnapShot.ReferenceBodyIndex == launchSite.body.flightGlobalsIndex) @@ -387,25 +392,25 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit if (body == null) { - Log.Normal("Could not find body for vessel"); + Log.Normal($"Could not find body for vessel ({vessel?.vesselName})"); return false; } if (body != launchSite.body) { - Log.Normal("Vessel is on different body than Launchsite"); + Log.Normal($"Vessel ({vessel?.vesselName}) is on different body than Launchsite"); return false; } if (distance == 0) { - Log.Normal("Vessel has same position as Launchsite, probably floating point error. Using gps checks instead."); + Log.Normal($"Vessel ({vessel?.vesselName}) has same position as Launchsite, probably floating point error. Using gps checks instead."); Vector2d tol = GetLatLonTolerance(launchSite.staticInstance.groupCenter.RefLatitude, launchSite.staticInstance.groupCenter.RefLongitude, maxDistance, body.Radius + launchSite.staticInstance.groupCenter.RadiusOffset); if (Math.Abs(vessel.latitude - launchSite.staticInstance.groupCenter.RefLatitude) > tol.y || Math.Abs(vessel.longitude - launchSite.staticInstance.groupCenter.RefLongitude) > tol.x) { - Log.Normal("Vessel is outside lat/lon tolerance"); + Log.Normal($"Vessel ({vessel?.vesselName}) is outside lat/lon tolerance"); Log.Debug($"Lat/Lon tolerance: {tol.y}, {tol.x}"); Log.Debug($"Vessel Lat/Lon: {vessel.latitude}, {vessel.longitude}"); Log.Debug($"Launchsite Lat/Lon: {launchSite.staticInstance.groupCenter.RefLatitude}, {launchSite.staticInstance.groupCenter.RefLongitude}"); @@ -413,7 +418,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else { - Log.Normal("Found Vessel at Launchsite with:"); + Log.Normal($"Found Vessel ({vessel?.vesselName}) at Launchsite inside lat/lon tolerance"); Log.Debug($"Lat/Lon tolerance: {tol.y}, {tol.x}"); Log.Debug($"Vessel Lat/Lon: {vessel.latitude}, {vessel.longitude}"); Log.Debug($"Launchsite Lat/Lon: {launchSite.staticInstance.groupCenter.RefLatitude}, {launchSite.staticInstance.groupCenter.RefLongitude}"); @@ -422,7 +427,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else if (distance < maxDistance) { - Log.Normal("Found Vessel at Launchsite with distance: " + distance); + Log.Normal($"Found Vessel ({vessel?.vesselName}) at Launchsite with distance: " + distance); return true; } } From 514b5e939502d13cedaa634240e85ca88f5468c9 Mon Sep 17 00:00:00 2001 From: Clayel Date: Fri, 27 Feb 2026 19:11:16 -0500 Subject: [PATCH 2/4] wording --- src/Core/LaunchSites/LaunchSiteChecks.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/LaunchSites/LaunchSiteChecks.cs b/src/Core/LaunchSites/LaunchSiteChecks.cs index 9001423..0423c68 100644 --- a/src/Core/LaunchSites/LaunchSiteChecks.cs +++ b/src/Core/LaunchSites/LaunchSiteChecks.cs @@ -377,7 +377,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else if (launchSite == null) { - Log.Normal($"Launchsite is null, cannot find vessel ({vessel?.vesselName}) at Squad launchsite"); + Log.Normal($"Launchsite is null, did not find vessel ({vessel?.vesselName}) at Squad launchsite"); return false; } } From 1c5c56007cd5ac6939aae45710ef3727fa773cbd Mon Sep 17 00:00:00 2001 From: Clayel Date: Fri, 27 Feb 2026 19:13:15 -0500 Subject: [PATCH 3/4] vessel is already confirmed to be non-null --- src/Core/LaunchSites/LaunchSiteChecks.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Core/LaunchSites/LaunchSiteChecks.cs b/src/Core/LaunchSites/LaunchSiteChecks.cs index 0423c68..f6bbb89 100644 --- a/src/Core/LaunchSites/LaunchSiteChecks.cs +++ b/src/Core/LaunchSites/LaunchSiteChecks.cs @@ -377,7 +377,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else if (launchSite == null) { - Log.Normal($"Launchsite is null, did not find vessel ({vessel?.vesselName}) at Squad launchsite"); + Log.Normal($"Launchsite is null, did not find vessel ({vessel.vesselName}) at Squad launchsite"); return false; } } @@ -392,25 +392,25 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit if (body == null) { - Log.Normal($"Could not find body for vessel ({vessel?.vesselName})"); + Log.Normal($"Could not find body for vessel ({vessel.vesselName})"); return false; } if (body != launchSite.body) { - Log.Normal($"Vessel ({vessel?.vesselName}) is on different body than Launchsite"); + Log.Normal($"Vessel ({vessel.vesselName}) is on different body than Launchsite"); return false; } if (distance == 0) { - Log.Normal($"Vessel ({vessel?.vesselName}) has same position as Launchsite, probably floating point error. Using gps checks instead."); + Log.Normal($"Vessel ({vessel.vesselName}) has same position as Launchsite, probably floating point error. Using gps checks instead."); Vector2d tol = GetLatLonTolerance(launchSite.staticInstance.groupCenter.RefLatitude, launchSite.staticInstance.groupCenter.RefLongitude, maxDistance, body.Radius + launchSite.staticInstance.groupCenter.RadiusOffset); if (Math.Abs(vessel.latitude - launchSite.staticInstance.groupCenter.RefLatitude) > tol.y || Math.Abs(vessel.longitude - launchSite.staticInstance.groupCenter.RefLongitude) > tol.x) { - Log.Normal($"Vessel ({vessel?.vesselName}) is outside lat/lon tolerance"); + Log.Normal($"Vessel ({vessel.vesselName}) is outside lat/lon tolerance"); Log.Debug($"Lat/Lon tolerance: {tol.y}, {tol.x}"); Log.Debug($"Vessel Lat/Lon: {vessel.latitude}, {vessel.longitude}"); Log.Debug($"Launchsite Lat/Lon: {launchSite.staticInstance.groupCenter.RefLatitude}, {launchSite.staticInstance.groupCenter.RefLongitude}"); @@ -418,7 +418,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else { - Log.Normal($"Found Vessel ({vessel?.vesselName}) at Launchsite inside lat/lon tolerance"); + Log.Normal($"Found Vessel ({vessel.vesselName}) at Launchsite inside lat/lon tolerance"); Log.Debug($"Lat/Lon tolerance: {tol.y}, {tol.x}"); Log.Debug($"Vessel Lat/Lon: {vessel.latitude}, {vessel.longitude}"); Log.Debug($"Launchsite Lat/Lon: {launchSite.staticInstance.groupCenter.RefLatitude}, {launchSite.staticInstance.groupCenter.RefLongitude}"); @@ -427,7 +427,7 @@ public static bool VesselAtLaunchSite(ProtoVessel vessel, KKLaunchSite launchSit } else if (distance < maxDistance) { - Log.Normal($"Found Vessel ({vessel?.vesselName}) at Launchsite with distance: " + distance); + Log.Normal($"Found Vessel ({vessel.vesselName}) at Launchsite with distance: " + distance); return true; } } From 4e77c112785f23cf5e9bd1bbaf0b7807fb3dad65 Mon Sep 17 00:00:00 2001 From: Clayel Date: Sun, 19 Apr 2026 14:52:40 -0400 Subject: [PATCH 4/4] remove the file delete thing --- src/Core/MapDecals/DecalsDatabase.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Core/MapDecals/DecalsDatabase.cs b/src/Core/MapDecals/DecalsDatabase.cs index 1be4d15..327909e 100644 --- a/src/Core/MapDecals/DecalsDatabase.cs +++ b/src/Core/MapDecals/DecalsDatabase.cs @@ -41,11 +41,6 @@ internal static void DeleteMapDecalInstance(MapDecalInstance instance) _allMapDecalInstances.Remove(instance); allMapDecalInstances = _allMapDecalInstances.ToArray(); Log.Debug("MapDecal instace " + instance.Name + " removed from Database"); - - if (instance.configPath != null && System.IO.File.Exists(KSPUtil.ApplicationRootPath + "GameData/" + instance.configPath)) - { - System.IO.File.Delete(KSPUtil.ApplicationRootPath + "GameData/" + instance.configPath); - } } }