From 535ae8aa89f7881a96508c045ea3f50b120b7826 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 5 Apr 2026 04:30:32 -0700 Subject: [PATCH] fix(ui): resolve map 0 name and allow guild queries at character screen getMapName() returned empty for mapId 0 (Eastern Kingdoms) due to an early return guard. Remove it since 0 is a valid map ID. queryGuildInfo() required IN_WORLD state but the character screen is at CHAR_LIST_RECEIVED. The server accepts CMSG_GUILD_QUERY before login, so just check for a connected socket. --- src/game/game_handler.cpp | 1 - src/game/social_handler.cpp | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 80460992..3f8bd0f4 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -7104,7 +7104,6 @@ void GameHandler::loadMapNameCache() const { } std::string GameHandler::getMapName(uint32_t mapId) const { - if (mapId == 0) return {}; loadMapNameCache(); auto it = mapNameCache_.find(mapId); return (it != mapNameCache_.end()) ? it->second : std::string{}; diff --git a/src/game/social_handler.cpp b/src/game/social_handler.cpp index ae9b2716..2c154f15 100644 --- a/src/game/social_handler.cpp +++ b/src/game/social_handler.cpp @@ -924,7 +924,9 @@ void SocialHandler::declineGuildInvite() { } void SocialHandler::queryGuildInfo(uint32_t guildId) { - if (owner_.getState() != WorldState::IN_WORLD || !owner_.socket) return; + // Allow guild queries at the character screen too — the socket is + // connected and the server accepts CMSG_GUILD_QUERY before login. + if (!owner_.socket) return; auto packet = GuildQueryPacket::build(guildId); owner_.socket->send(packet); }