|
|
|
@ -88,7 +88,9 @@ public partial class PickupController : Node3D |
|
|
|
|
EnsureCurrentItemValid(); |
|
|
|
|
|
|
|
|
|
if (HasItemsHeld) { |
|
|
|
|
if ((RayToMouseCursor() is RayResult ray) && (ray.Collider is Grid grid)) { |
|
|
|
|
if ((RayToMouseCursor() is RayResult ray) && (ray.Collider is Grid grid) |
|
|
|
|
// Ensure item is not being added to itself or nested items. |
|
|
|
|
&& !((grid.GetParent() == CurrentItem) || grid.ContainsItem(CurrentItem))) { |
|
|
|
|
var transform = CurrentItem.GlobalTransform with { Origin = ray.Position }; |
|
|
|
|
transform = grid.Snap(transform, ray.Normal, CurrentItem); |
|
|
|
|
_preview.GlobalTransform = transform; |
|
|
|
|