Skip to content

Commit

Permalink
Fix broken custom messages
Browse files Browse the repository at this point in the history
  • Loading branch information
lilDavid committed Dec 21, 2023
1 parent 0d0d59f commit 426efee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions soh/soh/Enhancements/custom-message/CustomMessageManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ void CustomMessage::Replace(std::string&& oldStr, std::string&& newEnglish, std:

void CustomMessage::Format(ItemID iid) {
for (std::string* str : { &english, &french, &german }) {
str->insert(0, ITEM_OBTAINED(iid));
// HACK: this is so messed up
str->insert(0, ITEM_OBTAINED(iid > ITEM_BOW_ARROW_BOMB ? iid - 1 : iid));
size_t start_pos = 0;
std::replace(str->begin(), str->end(), '&', NEWLINE()[0]);
while ((start_pos = str->find('^', start_pos)) != std::string::npos) {
Expand Down Expand Up @@ -253,7 +254,7 @@ bool CustomMessageManager::ClearMessageTable(std::string tableID) {
return true;
}

bool CustomMessageManager::AddCustomMessageTable(std::string tableID) {
bool CustomMessageManager::AddCustomMessageTable(std::string tableID) {
CustomMessageTable newMessageTable;
return messageTables.emplace(tableID, newMessageTable).second;
}

0 comments on commit 426efee

Please sign in to comment.