From 1511cc5cb078f083850f77422ec273e16c0785c9 Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Mon, 4 Aug 2025 01:18:35 -0400 Subject: [PATCH] Fix interaction volumes breaking when no shape --- NewHorizons/Builder/Volumes/InteractionVolumeBuilder.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/NewHorizons/Builder/Volumes/InteractionVolumeBuilder.cs b/NewHorizons/Builder/Volumes/InteractionVolumeBuilder.cs index 2f5c0122..6c00878b 100644 --- a/NewHorizons/Builder/Volumes/InteractionVolumeBuilder.cs +++ b/NewHorizons/Builder/Volumes/InteractionVolumeBuilder.cs @@ -15,11 +15,15 @@ namespace NewHorizons.Builder.Volumes public static InteractReceiver Make(GameObject planetGO, Sector sector, InteractionVolumeInfo info, IModBehaviour mod) { // Interaction volumes must use colliders because the first-person interaction system uses raycasting - if (info.shape != null) + if (info.shape != null && info.shape?.useShape == false) { - info.shape.useShape = false; + NHLogger.LogError($"Interaction volumes only support colliders. Affects planet [{planetGO.name}]. Set useShape to false."); } + // If info.shape was null, it will still default to using a sphere with info.radius, just make sure it does so with a collider + info.shape ??= new(); + info.shape.useShape = false; + var receiver = VolumeBuilder.Make(planetGO, sector, info); receiver.gameObject.layer = Layer.Interactible;