From 81dbb7915a32355d27aafd3de33294455abc7a7a Mon Sep 17 00:00:00 2001 From: Ryder7223 <114200735+ryder7223@users.noreply.github.com> Date: Fri, 2 May 2025 13:22:39 +0800 Subject: [PATCH] Update savedata.md --- mods/savedata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/savedata.md b/mods/savedata.md index 498ba92..e04d109 100644 --- a/mods/savedata.md +++ b/mods/savedata.md @@ -48,7 +48,7 @@ auto value = Mod::get()->getSavedValue("my-saved-value"); auto data = Mod::get()->getSavedValue("data", MyCustomSaveData { .x = 0, .y = 0 }); ``` -As an useful little tip, `setSavedValue` returns the previous saved value, and if there is no previous saved value, default constructs it and returns that. You can use this knowledge, and combined with the knowledge that the default constructor for `bool` is false, to write one-time info popups using a single self-contained if statement: +As a useful little tip, `setSavedValue` returns the previous saved value, and if there is no previous saved value, default constructs it and returns that. You can use this knowledge, and combined with the knowledge that the default constructor for `bool` is false, to write one-time info popups using a single self-contained if statement: ```cpp if (!Mod::get()->setSavedValue("shown-upload-guidelines", true)) {