mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
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.
This commit is contained in:
parent
2e30490fc5
commit
535ae8aa89
2 changed files with 3 additions and 2 deletions
|
|
@ -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{};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue