Skip to content

Commit 28a775c

Browse files
committed
Fixed save data keys not being checked correctly before usage
1 parent 9c027ce commit 28a775c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [2.0.1] - 2024-03-03
9+
10+
### Fixed
11+
12+
- `RouletteManager` not getting new keys because it just assumed they existed prior
13+
814
## [2.0.0] - 2024-03-01
915

1016
GD-Roulette commit everything at once challenge (mildly possible)

src/roulette/manager/RouletteManager.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,31 @@ struct RouletteManager
8484

8585
if (!Mod::get()->hasSavedValue("difficulty-array"))
8686
Mod::get()->setSavedValue<std::vector<bool>>("difficulty-array", { true, false, false, false, false, false });
87-
88-
{
89-
auto& arr = getFromSaveContainer("difficulty-array").as_array();
90-
91-
previousDifficulty = getDifficultyFromSaveContainer("difficulty-array");
92-
previousDemonDifficulty = getDifficultyFromSaveContainer("demon-difficulty-array");
93-
verifyArray("difficulty-array", arr);
94-
}
87+
else
88+
verifyArray("difficulty-array", getFromSaveContainer("difficulty-array").as_array());
9589

9690

9791
if (!Mod::get()->hasSavedValue("demon-difficulty-array"))
9892
Mod::get()->setSavedValue<std::vector<bool>>("demon-difficulty-array", { true, false, false, false, false });
99-
verifyArray("demon-difficulty-array", saveContainer["demon-difficulty-array"].as_array());
93+
else
94+
verifyArray("demon-difficulty-array", saveContainer["demon-difficulty-array"].as_array());
10095

10196

10297
if (!Mod::get()->hasSavedValue("selected-list-array"))
10398
Mod::get()->setSavedValue<std::vector<bool>>("selected-list-array", { true, false, false, false });
104-
verifyArray("selected-list-array", saveContainer["selected-list-array"].as_array());
99+
else
100+
verifyArray("selected-list-array", saveContainer["selected-list-array"].as_array());
105101

106102

107103
if (!Mod::get()->hasSavedValue("gdListID"))
108104
Mod::get()->setSavedValue<uint64_t>("gdListID", static_cast<uint64_t>(gdListID));
109105
else
110106
gdListID = static_cast<int>(Mod::get()->getSavedValue<uint64_t>("gdListID"));
111107

108+
109+
previousDifficulty = getDifficultyFromSaveContainer("difficulty-array");
110+
previousDemonDifficulty = getDifficultyFromSaveContainer("demon-difficulty-array");
111+
112112
m_hasInitManager = true;
113113
}
114114
}

0 commit comments

Comments
 (0)