From 0b2780791d51dd676d04b53c3643681bd0ea07c5 Mon Sep 17 00:00:00 2001 From: Caladius Date: Mon, 11 Nov 2024 20:50:04 -0500 Subject: [PATCH] Utilize RandomElement for hints --- soh/soh/Enhancements/randomizer/Plandomizer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/randomizer/Plandomizer.cpp b/soh/soh/Enhancements/randomizer/Plandomizer.cpp index 4cca1e49613..9a57f0d1a7c 100644 --- a/soh/soh/Enhancements/randomizer/Plandomizer.cpp +++ b/soh/soh/Enhancements/randomizer/Plandomizer.cpp @@ -381,14 +381,11 @@ void PlandomizerItemImageCorrection(Rando::Item randoItem) { } void PlandomizerRandomizeHint(int32_t status, int32_t index) { - int32_t roll; if (status == HINT_SINGLE) { - roll = (rand() % Rando::StaticData::hintTextTable.size()); - plandoHintData[index].hintText = Rando::StaticData::hintTextTable[roll].GetHintMessage().GetForCurrentLanguage(); + plandoHintData[index].hintText = RandomElement(Rando::StaticData::hintTextTable).GetHintMessage().GetForCurrentLanguage(); } else { for (auto& hint : plandoHintData) { - roll = (rand() % Rando::StaticData::hintTextTable.size()); - hint.hintText = Rando::StaticData::hintTextTable[roll].GetHintMessage().GetForCurrentLanguage(); + hint.hintText = RandomElement(Rando::StaticData::hintTextTable).GetHintMessage().GetForCurrentLanguage(); } } }