diff --git a/CMakeLists.txt b/CMakeLists.txt index e2d5f46..4ace363 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.21) -project(randstalker_archipelago VERSION 1.3.3 LANGUAGES CXX) +project(randstalker_archipelago VERSION 1.3.4 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) diff --git a/README.md b/README.md index 6156eb1..9d94962 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![version](https://img.shields.io/badge/Version-1.3.3-blue) +![version](https://img.shields.io/badge/Version-1.3.4-blue) Join Discord diff --git a/src/preset_builder.cpp b/src/preset_builder.cpp index 9d9dd67..d2bb025 100644 --- a/src/preset_builder.cpp +++ b/src/preset_builder.cpp @@ -101,7 +101,19 @@ static json build_world_json(const json& slot_data, const json& locations_data, if(prices.contains(item_source_name)) output["price"] = prices.at(item_source_name); if(data["player"] != player_name) - output["player"] = data["player"]; + { + std::string real_player_name = data["player"]; + + // This is a hacky fix to extract the alias part from the name in cases where slot name fetched from server + // looks like "Player Alias (Real Slot Name Causing A Really Long String)". + // This was causing textbox overflows in some places, and you really don't want that to happen for the game + // to remain stable. + auto pos = real_player_name.find(" ("); + if (pos != std::string::npos) + real_player_name = real_player_name.substr(0, pos); + + output["player"] = real_player_name; + } world["itemSources"][item_source_name] = output; }