Fix random seed string gen (#6697)

This commit is contained in:
A Green Spoon
2026-06-08 21:59:02 -04:00
committed by GitHub
parent 43777996a8
commit 47e386197d
3 changed files with 5 additions and 5 deletions
@@ -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);
+1 -1
View File
@@ -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()