diff options
| author | Philip Dubé <159546+serprex@users.noreply.github.com> | 2026-10-04 17:27:08 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-04 17:27:08 +0000 |
| commit | 3ea7aa9b77ce34207e4f636a2b2134dfaf4a8257 (patch) | |
| tree | 38f1c1a37e0ce1dbabb6a9c192c6667399b81b95 | |
| parent | 12e17c68a8afd74ad178225c3e30ee06d6bc1b47 (diff) | |
Fix boss rush name being garbage with non-PAL encoding (#7304)
| -rw-r--r-- | soh/soh/Enhancements/boss-rush/BossRush.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/soh/soh/Enhancements/boss-rush/BossRush.cpp b/soh/soh/Enhancements/boss-rush/BossRush.cpp index 7e7e970c4..b35c30b2b 100644 --- a/soh/soh/Enhancements/boss-rush/BossRush.cpp +++ b/soh/soh/Enhancements/boss-rush/BossRush.cpp @@ -1,3 +1,4 @@ +#include <algorithm> #include <array> #include <string> #include <vector> @@ -6,6 +7,7 @@ #include <libultraship/bridge/consolevariablebridge.h> #include "BossRush.h" +#include "soh/SaveManager.h" #include "soh/ShipInit.hpp" #include "soh/Enhancements/game-interactor/GameInteractor.h" #include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h" @@ -569,11 +571,11 @@ void BossRush_HandleCompleteBoss(PlayState* play) { extern "C" void BossRush_InitSave() { - // Set player name to Lonk for the few textboxes that show up during Boss Rush. Player can't input their own name. - std::array<char, 8> brPlayerName = { 21, 50, 49, 46, 62, 62, 62, 62 }; - for (int i = 0; i < ARRAY_COUNT(gSaveContext.playerName); i++) { - gSaveContext.playerName[i] = brPlayerName[i]; - } + // Set player name to Link using PAL charset for few textboxes that show up during Boss Rush. + static const u8 brPlayerName[] = { 0x15, 0x12, 0x17, 0x14, 0x3E, 0x3E, 0x3E, 0x3E }; + static_assert(sizeof(brPlayerName) == sizeof(gSaveContext.playerName)); + std::copy(std::begin(brPlayerName), std::end(brPlayerName), gSaveContext.playerName); + gSaveContext.ship.filenameLanguage = NAME_LANGUAGE_PAL; gSaveContext.ship.quest.id = QUEST_BOSSRUSH; gSaveContext.ship.quest.data.bossRush.isPaused = true; |
