diff --git a/src/nat/systems/PlaygroundSystem.kiss b/src/nat/systems/PlaygroundSystem.kiss index f823e30..b623036 100644 --- a/src/nat/systems/PlaygroundSystem.kiss +++ b/src/nat/systems/PlaygroundSystem.kiss @@ -44,9 +44,10 @@ (when (catsMatch e .catsMatch (dictGet archive.playgrounds _playgroundKey)) (when !(hasComponent e Positions) (addComponent archive e Positions (new Map))) - (withWritableComponents archive e [positions Positions] + (let [positions (readComponent e Positions)] (when !(positions.exists _playgroundKey) - (dictSet positions _playgroundKey (defaultPosition e)))) + (withWritableComponents archive e [positions Positions] + (dictSet positions _playgroundKey (defaultPosition e))))) (let [pos (dictGet (readComponent e Positions) _playgroundKey)] (processor archive e pos ui))))) (set this.onRemoveEntry