fix a null position component bug

This commit is contained in:
2022-09-08 05:07:49 +00:00
parent 599b39370b
commit acb8127e10

View File

@@ -35,11 +35,12 @@
(when _playgroundKey
(super.process archive ui)
(doFor e (entries.iterator)
(let [pos (dictGet (readComponent e Positions) _playgroundKey)]
(doFor =>e2id _ (readComponentOr e Connections (new Map<String,Int>))
(whenLet [e2 (dictGet archive.entries e2id)
pos2 (dictGet (readComponent e2 Positions) _playgroundKey)]
(connectionProcessor archive e pos e2 pos2 ui)))))))
(when (hasComponent e Positions)
(let [pos (dictGet (readComponent e Positions) _playgroundKey)]
(doFor =>e2id _ (readComponentOr e Connections (new Map<String,Int>))
(whenLet [e2 (dictGet archive.entries e2id)
pos2 (dictGet (readComponent e2 Positions) _playgroundKey)]
(connectionProcessor archive e pos e2 pos2 ui))))))))
(method defaultPosition [:Entry e]
(object x 0.0 y 0.0 z 0.0))