Fix shopsanity soft lock (#6502)

GetForCurrentLanguage() defaults to MF_FORMATTED, appending MESSAGE_END (\x02) to output string

Revert using hint name for items in shops. Other merchants return GetHintMessage directly
This commit is contained in:
Philip Dubé 2026-04-14 06:41:37 +00:00 committed by GitHub
parent adb1e46ba9
commit feb489cab0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -24,8 +24,8 @@ extern PlayState* gPlayState;
RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_ALL)) RAND_GET_OPTION(RSK_SHUFFLE_MERCHANTS).Is(RO_SHUFFLE_MERCHANTS_ALL))
void BuildMerchantMessage(CustomMessage& msg, RandomizerCheck rc, bool mysterious = true) { void BuildMerchantMessage(CustomMessage& msg, RandomizerCheck rc, bool mysterious = true) {
RandomizerGet rgid = RAND_GET_ITEM(rc)->GetPlacedRandomizerGet(); auto location = RAND_GET_ITEM(rc);
uint16_t price = RAND_GET_ITEM(rc)->GetPrice(); RandomizerGet rgid = location->GetPlacedRandomizerGet();
CustomMessage itemName; CustomMessage itemName;
std::string color = Rando::StaticData::RetrieveItem(static_cast<RandomizerGet>(rgid)).GetColor(); std::string color = Rando::StaticData::RetrieveItem(static_cast<RandomizerGet>(rgid)).GetColor();
if (mysterious) { if (mysterious) {
@ -37,10 +37,14 @@ void BuildMerchantMessage(CustomMessage& msg, RandomizerCheck rc, bool mysteriou
color = "%g"; color = "%g";
} else { } else {
const Rando::Item& item = Rando::StaticData::RetrieveItem(rgid); const Rando::Item& item = Rando::StaticData::RetrieveItem(rgid);
itemName = item.GetHint().GetHintMessage().GetForCurrentLanguage(); if (Rando::StaticData::GetLocation(rc)->IsShop()) {
itemName = CustomMessage(Rando::StaticData::RetrieveItem(rgid).GetName());
} else {
itemName = item.GetHint().GetHintMessage();
}
} }
msg.Replace("[[color]]", color); msg.Replace("[[color]]", color);
msg.InsertNames({ itemName, CustomMessage(std::to_string(price)) }); msg.InsertNames({ itemName, CustomMessage(std::to_string(location->GetPrice())) });
} }
void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) { void BuildBeanGuyMessage(uint16_t* textId, bool* loadFromMessageTable) {

View file

@ -1,6 +1,5 @@
#include "location.h" #include "location.h"
#include "static_data.h" #include "static_data.h"
#include <algorithm>
#include <assert.h> #include <assert.h>
#include "option.h" #include "option.h"