@@ -1194,11 +1194,11 @@ TweakError update_korl_dialog(World& world) {
11941194
11951195 std::vector<std::u16string> hintMessages = {u" " };
11961196 size_t curLine = 0 ;
1197- for (auto location : world.korlHints ) {
1198- std::u16string hint = location-> hint .text [language];
1199- hint = Text::word_wrap_string (hint , 42 ); // wrap shorter lines, some edge cases are still too wide with 43
1200- hint = Text::pad_str_4_lines (hint );
1201- const size_t numLines = std::count (hint .begin (), hint .end (), u' \n ' ); // 4 for most hints, 8+ for long hints with multiple textboxes
1197+ for (auto & hint : world.korlHints ) {
1198+ std::u16string hintText = hint.text [language];
1199+ hintText = Text::word_wrap_string (hintText , 42 ); // wrap shorter lines, some edge cases are still too wide with 43
1200+ hintText = Text::pad_str_4_lines (hintText );
1201+ const size_t numLines = std::count (hintText .begin (), hintText .end (), u' \n ' ); // 4 for most hints, 8+ for long hints with multiple textboxes
12021202
12031203 // if we would have >10 textboxes
12041204 if (curLine + numLines > 40 ) {
@@ -1207,7 +1207,7 @@ TweakError update_korl_dialog(World& world) {
12071207 curLine = 0 ; // restart line counter
12081208 }
12091209
1210- hintMessages.back () += hint ; // add hint to back of current message
1210+ hintMessages.back () += hintText ; // add hint to back of current message
12111211 curLine += numLines; // add hint lines to count
12121212 }
12131213
@@ -1253,13 +1253,13 @@ TweakError update_korl_dialog(World& world) {
12531253 for (const auto & language : Text::supported_languages) {
12541254 std::u16string hintLines = u" " ;
12551255 size_t i = 0 ; // counter to know when to add null terminator
1256- for (auto location : world.korlHyruleHints ) {
1257- std::u16string hint = Text::word_wrap_string (location-> hint .text [language], 43 );
1256+ for (auto & hint : world.korlHyruleHints ) {
1257+ std::u16string hintText = Text::word_wrap_string (hint.text [language], 43 );
12581258 ++i;
12591259 if (i == world.korlHyruleHints .size ()) {
1260- hint += u' \0 ' ; // add null terminator on last hint before padding
1260+ hintText += u' \0 ' ; // add null terminator on last hint before padding
12611261 }
1262- hintLines += Text::pad_str_4_lines (hint );
1262+ hintLines += Text::pad_str_4_lines (hintText );
12631263 }
12641264
12651265 RandoSession::CacheEntry& entry = g_session.openGameFile (" content/Common/Pack/permanent_2d_Us" + language + " .pack@SARC@message2_msbt.szs@YAZ0@SARC@message2.msbt@MSBT" );
@@ -1288,22 +1288,22 @@ TweakError update_ho_ho_dialog(World& world) {
12881288 RandoSession::CacheEntry& entry = g_session.openGameFile (" content/Common/Pack/permanent_2d_Us" + language + " .pack@SARC@message4_msbt.szs@YAZ0@SARC@message4.msbt@MSBT" );
12891289
12901290 entry.addAction ([=, &world](RandoSession* session, FileType* data) -> int {
1291- for (auto & [hohoLocation, hintLocations ] : world.hohoHints ) {
1291+ for (auto & [hohoLocation, hints ] : world.hohoHints ) {
12921292 std::u16string hintLines = u" " ;
12931293 size_t i = 0 ; // counter to know when to add null terminator
1294- for (auto location : hintLocations ) {
1295- std::u16string hint = u" " ;
1294+ for (auto & hint : hints ) {
1295+ std::u16string hintText = u" " ;
12961296 if (i == 0 ) {
1297- hint += SOUND (0x0103 ) u" Ho ho! " s;
1297+ hintText += SOUND (0x0103 ) u" Ho ho! " s;
12981298 }
12991299 i++;
1300- hint += location-> hint .text [language];
1301- hint = Text::word_wrap_string (hint , 43 );
1302- if (i == hintLocations .size ()) {
1303- hint += u' \0 ' ; // add null terminator on last hint before padding
1300+ hintText += hint.text [language];
1301+ hintText = Text::word_wrap_string (hintText , 43 );
1302+ if (i == hints .size ()) {
1303+ hintText += u' \0 ' ; // add null terminator on last hint before padding
13041304 }
1305- hint = Text::pad_str_4_lines (hint );
1306- hintLines += hint ;
1305+ hintText = Text::pad_str_4_lines (hintText );
1306+ hintLines += hintText ;
13071307 }
13081308 CAST_ENTRY_TO_FILETYPE (msbt, FileTypes::MSBTFile, data)
13091309
@@ -1327,16 +1327,16 @@ TweakError update_kreeb_dialog(World& world) {
13271327 entry.addAction ([=, &world](RandoSession* session, FileType* data) -> int {
13281328 std::u16string hintLines = u" " ;
13291329 size_t i = 0 ; // counter to know when to add null terminator
1330- for (auto location : world.kreebHints ) {
1331- std::u16string hint = u" " ;
1332- hint += location-> hint .text [language];
1333- hint = Text::word_wrap_string (hint , 43 );
1330+ for (auto & hint : world.kreebHints ) {
1331+ std::u16string hintText = u" " ;
1332+ hintText += hint.text [language];
1333+ hintText = Text::word_wrap_string (hintText , 43 );
13341334 ++i;
13351335 if (i == world.kreebHints .size ()) {
1336- hint += u' \0 ' ; // add null terminator on last hint before padding
1336+ hintText += u' \0 ' ; // add null terminator on last hint before padding
13371337 }
1338- hint = Text::pad_str_4_lines (hint );
1339- hintLines += hint ;
1338+ hintText = Text::pad_str_4_lines (hintText );
1339+ hintLines += hintText ;
13401340 }
13411341 CAST_ENTRY_TO_FILETYPE (msbt, FileTypes::MSBTFile, data)
13421342
@@ -1354,10 +1354,10 @@ TweakError rotate_ho_ho_to_face_hints(World& world) {
13541354 return TweakError::NONE;
13551355 }
13561356
1357- for (auto & [hohoLocation, hintLocations ] : world.hohoHints ) {
1357+ for (auto & [hohoLocation, hints ] : world.hohoHints ) {
13581358 std::string island = " " ;
1359- for (auto location : hintLocations ) {
1360- for (auto region : location->hintRegions ) {
1359+ for (auto & hint : hints ) {
1360+ for (auto region : hint. location ->hintRegions ) {
13611361 // If this region is a dungeon, use the dungeon's island instead
13621362 if (world.dungeons .contains (region)) {
13631363 region = world.dungeons [region].islands .front ();
0 commit comments