From 71a7af2102f7f3a3a33dc17f814609e04eea10d4 Mon Sep 17 00:00:00 2001 From: jedarden Date: Thu, 9 Apr 2026 12:41:58 -0400 Subject: [PATCH] fix(s simulator): fix bugs in node.go - Fix NewNode() -> NewNodeSet() in SuggestedNodes() - Fix CornerPositions() to use minZ instead of minX for height calculation --- mothership/internal/simulator/node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mothership/internal/simulator/node.go b/mothership/internal/simulator/node.go index cf9c32d..b00aac8 100644 --- a/mothership/internal/simulator/node.go +++ b/mothership/internal/simulator/node.go @@ -206,8 +206,8 @@ func (ns *NodeSet) UnmarshalJSON(data []byte) error { // CornerPositions returns suggested node positions at room corners // for a given space. Useful for quick initial placement. func CornerPositions(s *Space) []Point { - minX, minY, _, maxX, maxY, maxZ := s.Bounds() - height := (maxZ - minX) / 2 // Average height + minX, minY, minZ, maxX, maxY, maxZ := s.Bounds() + height := (maxZ - minZ) / 2 // Average height return []Point{ {X: minX, Y: minY, Z: height}, // Bottom-left, high @@ -222,7 +222,7 @@ func CornerPositions(s *Space) []Point { // SuggestedNodes creates a suggested node set for a space // with nodes positioned at corners and mid-points func SuggestedNodes(s *Space, count int) *NodeSet { - ns := NewNode() + ns := NewNodeSet() positions := CornerPositions(s) // Use corner positions, then add random positions if needed