diff --git a/resources/assets/zscript/lib/LemonTree/lemontreebranch.zs b/resources/assets/zscript/lib/LemonTree/lemontreebranch.zs index ea06ba7..1efe399 100644 --- a/resources/assets/zscript/lib/LemonTree/lemontreebranch.zs +++ b/resources/assets/zscript/lib/LemonTree/lemontreebranch.zs @@ -2,6 +2,19 @@ class LemonTreeBranch { bool _persist; // allows data to persist between games + LemonTreeBranch GetStore() { + LemonTreeSession ltSession = LemonTree.GetSession(); + if (ltSession) { + bool exists = false; + LemonTreeBranch store; + [store, exists] = ltSession.stores.CheckValue(self.GetClassName()); + if (exists) { + return store; + } + } + return null; + } + virtual void Init() { self._persist = false; console.printf("%s: Init", self.GetClassName());