Skip to content

Commit 0b8762a

Browse files
authored
Update savedata.md (#71)
1 parent 09cf547 commit 0b8762a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mods/savedata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ auto value = Mod::get()->getSavedValue<float>("my-saved-value");
4848
auto data = Mod::get()->getSavedValue<MyCustomSaveData>("data", MyCustomSaveData { .x = 0, .y = 0 });
4949
```
5050

51-
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:
51+
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:
5252

5353
```cpp
5454
if (!Mod::get()->setSavedValue("shown-upload-guidelines", true)) {

0 commit comments

Comments
 (0)