From e5cadccd3c62c239b0ff808d2c21bd318873744c Mon Sep 17 00:00:00 2001 From: Saghm Rossi Date: Tue, 16 Sep 2025 19:23:13 -0400 Subject: [PATCH] Update API.md example for PersistentVars to check nil to avoid overwriting value --- Docs/API.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Docs/API.md b/Docs/API.md index 71f654cb2..1dadfff4f 100644 --- a/Docs/API.md +++ b/Docs/API.md @@ -111,7 +111,9 @@ The Lua state and all local variables are reset after each game reload. For keep Example: ```lua -PersistentVars = {} +if not PersistentVars then + PersistentVars = {} +end ... -- Variable will be restored after the savegame finished loading function doStuff()