mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-23 08:38:52 -05:00
Explicitly clears the entire ItemLocations array. (#3820)
This commit is contained in:
parent
1669393277
commit
63413e8159
@ -46,6 +46,7 @@ bool GenerateRandomizer(std::set<RandomizerCheck> excludedLocations, std::set<Ra
|
||||
uint32_t seedHash = boost::hash_32<std::string>{}(ctx->GetSettings()->GetSeedString());
|
||||
ctx->GetSettings()->SetSeed(seedHash & 0xFFFFFFFF);
|
||||
|
||||
ctx->ClearItemLocations();
|
||||
int ret = Playthrough::Playthrough_Init(ctx->GetSettings()->GetSeed(), excludedLocations, enabledTricks);
|
||||
if (ret < 0) {
|
||||
if (ret == -1) { // Failed to generate after 5 tries
|
||||
|
@ -226,6 +226,12 @@ std::vector<RandomizerCheck> Context::GetLocations(const std::vector<RandomizerC
|
||||
return locationsInCategory;
|
||||
}
|
||||
|
||||
void Context::ClearItemLocations() {
|
||||
for (int i = 0; i < itemLocationTable.size(); i++) {
|
||||
GetItemLocation(static_cast<RandomizerCheck>(i))->ResetVariables();
|
||||
}
|
||||
}
|
||||
|
||||
void Context::ItemReset() {
|
||||
for (const RandomizerCheck il : allLocations) {
|
||||
GetItemLocation(il)->ResetVariables();
|
||||
|
@ -50,6 +50,7 @@ class Context {
|
||||
Category categoryInclude, Category categoryExclude = Category::cNull);
|
||||
void AddExcludedOptions();
|
||||
void LocationReset();
|
||||
void ClearItemLocations();
|
||||
void ItemReset();
|
||||
void HintReset();
|
||||
void CreateItemOverrides();
|
||||
|
Loading…
Reference in New Issue
Block a user