Skip to content

Commit

Permalink
remove invalid chars from list names
Browse files Browse the repository at this point in the history
  • Loading branch information
Cvolton committed Jun 30, 2024
1 parent b88535d commit 95f4321
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/managers/BetterInfoCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ void BetterInfoCache::cacheList(GJLevelList* list) {
auto idString = std::to_string(list->m_listID);
if(!m_json["list-info-dict"][idString].is_object()) m_json["list-info-dict"][idString] = matjson::Object();

m_json["list-info-dict"][idString]["name"] = std::string(list->m_listName);
auto name = std::string(list->m_listName);
for(auto it = name.begin(); it < name.end(); it++) {
if(*it < 0x20) *it = ' ';
}

m_json["list-info-dict"][idString]["name"] = name;
m_json["list-info-dict"][idString]["levels"] = std::vector<int>(list->m_levels);
m_json["list-info-dict"][idString]["levels-to-claim"] = list->m_levelsToClaim;
m_json["list-info-dict"][idString]["diamonds"] = list->m_diamonds;
Expand Down

0 comments on commit 95f4321

Please sign in to comment.