From 6ee8f16cc42a94d073576a4742e219ac40d30784 Mon Sep 17 00:00:00 2001 From: xen-42 Date: Sat, 19 Apr 2025 19:17:53 -0400 Subject: [PATCH] Change volumes back to shapes by default not colliders (broke mod puzzles with volumes on held items) --- NewHorizons/Builder/Props/ShapeBuilder.cs | 15 +++++++++++++-- NewHorizons/External/Modules/Props/ShapeInfo.cs | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NewHorizons/Builder/Props/ShapeBuilder.cs b/NewHorizons/Builder/Props/ShapeBuilder.cs index 1496e6e0..e2db47a5 100644 --- a/NewHorizons/Builder/Props/ShapeBuilder.cs +++ b/NewHorizons/Builder/Props/ShapeBuilder.cs @@ -42,17 +42,28 @@ namespace NewHorizons.Builder.Props { // Explicitly add either a shape or collider if specified if (info.useShape.Value) + { return AddShape(go, info); + } else + { return AddCollider(go, info); + } } else { - // Prefer colliders over shapes if no preference is specified - if (info.type is ShapeType.Sphere or ShapeType.Box or ShapeType.Capsule) + // Prefer shapes over colliders if no preference is specified and not using collision + // This is required for backwards compat (previously it defaulted to shapes) + // A common-ish puzzle is to put an insulating volume on a held item. Held items disabled all colliders when held, but don't disable shapes. + // Changing the default from shapes to colliders broke these puzzles + if (info.hasCollision) + { return AddCollider(go, info); + } else + { return AddShape(go, info); + } } } diff --git a/NewHorizons/External/Modules/Props/ShapeInfo.cs b/NewHorizons/External/Modules/Props/ShapeInfo.cs index 19b81ecb..7c63eea5 100644 --- a/NewHorizons/External/Modules/Props/ShapeInfo.cs +++ b/NewHorizons/External/Modules/Props/ShapeInfo.cs @@ -64,7 +64,8 @@ namespace NewHorizons.External.Modules.Props public bool hasCollision = false; /// - /// Whether to explicitly use a shape instead of a collider. Shapes do not support collision and are less performant, but support a wider set of shapes and are required by some components. Omit this unless you explicitly want to use a sphere, box, or capsule shape instead of a collider. + /// Whether to explicitly use a shape instead of a collider. Shapes do not support collision and are less performant, but support a wider set of shapes and are required by some components. + /// Defaults to using a shape, unless hasCollision is true where it defaults to using a collider. /// public bool? useShape; }