mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-09 21:00:40 -04:00
Fix random seed string gen (#6697)
This commit is contained in:
@@ -20,11 +20,11 @@ bool GenerateRandomizer(std::set<RandomizerCheck> excludedLocations, std::set<Ra
|
||||
|
||||
// if a blank seed was entered, make a random one
|
||||
if (seedInput.empty()) {
|
||||
char seedString[12];
|
||||
char seedString[11];
|
||||
for (size_t i = 0; i < 10; i++) {
|
||||
seedString[i] = '0' + ShipUtils::Random(0, 10);
|
||||
}
|
||||
seedString[11] = '\0';
|
||||
seedString[10] = '\0';
|
||||
seedInput = std::string(seedString);
|
||||
} else if (seedInput.rfind("seed_testing_count", 0) == 0 && seedInput.length() > 18) {
|
||||
int count;
|
||||
|
||||
@@ -94,11 +94,11 @@ int Playthrough_Repeat(std::set<RandomizerCheck> excludedLocations, std::set<Ran
|
||||
auto ctx = Rando::Context::GetInstance();
|
||||
uint32_t repeatedSeed = 0;
|
||||
for (int i = 0; i < count; i++) {
|
||||
char seedString[12];
|
||||
char seedString[11];
|
||||
for (size_t i = 0; i < 10; i++) {
|
||||
seedString[i] = '0' + ShipUtils::Random(0, 10);
|
||||
}
|
||||
seedString[11] = '\0';
|
||||
seedString[10] = '\0';
|
||||
ctx->SetSeedString(std::string(seedString));
|
||||
repeatedSeed = SohUtils::Hash(ctx->GetSeedString());
|
||||
ctx->SetSeed(repeatedSeed);
|
||||
|
||||
@@ -563,7 +563,7 @@ void SohMenu::AddMenuRandomizer() {
|
||||
for (size_t i = 0; i < 10; i++) {
|
||||
seedString[i] = '0' + ShipUtils::Random(0, 10);
|
||||
}
|
||||
seedString[11] = '\0';
|
||||
seedString[10] = '\0';
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (UIWidgets::Button(ICON_FA_ERASER, UIWidgets::ButtonOptions()
|
||||
|
||||
Reference in New Issue
Block a user