Fix splitted segments getting attached to unrelated paths

This commit is contained in:
DBotThePony 2025-01-15 21:53:33 +07:00
parent bd4fe17e33
commit eeea537715
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -399,7 +399,7 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
val touchedSegments = ReferenceArraySet<Segment>()
solution.forEach { touchedSegments.addAll(it.segment.split()) }
val path = SegmentPath(a.blockEntity.blockPos, b.blockEntity.blockPos)
touchedSegments.forEach { it.add(path) }
solution.forEach { it.segment.add(path) }
touchedSegments.forEach { it.tryCombine(touchedSegments) }