From 5c1839e35c01f31178199c6bbd25aacbdc7d8e37 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 2 Aug 2021 20:30:37 -0600 Subject: [PATCH] more careful entry saving --- src/nat/ArchiveController.kiss | 2 +- src/nat/Lib.kiss | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nat/ArchiveController.kiss b/src/nat/ArchiveController.kiss index 095d0c9..3136a18 100644 --- a/src/nat/ArchiveController.kiss +++ b/src/nat/ArchiveController.kiss @@ -186,5 +186,5 @@ files (VarText null)] (doFor e entries (doFor file files - (withWritableEntry archive e (addFile archive e file)))) + (addFile archive e file))) entries)) diff --git a/src/nat/Lib.kiss b/src/nat/Lib.kiss index 01f71de..61789e1 100644 --- a/src/nat/Lib.kiss +++ b/src/nat/Lib.kiss @@ -26,10 +26,10 @@ // TODO check not overwriting a component (defMacro addComponent [archive e componentType c] - `(let [componentId (Uuid.v4)] + `(withWritableEntry ,archive ,e (let [componentId (uuid.Uuid.v4)] (dictSet .components ,e ,(symbolName componentType) componentId) (writeComponent ,archive ,e ,componentType ,c) - ,e)) + ,e))) // Retrieve multiple components from an Entity with mutable access. // All components will be serialized after the block is done.