fix: show area name in SMSG_ZONE_UNDER_ATTACK system message

Replace the raw area ID in the zone-under-attack message with the
resolved area name from the zone manager, matching retail WoW behavior
('Hillsbrad Foothills is under attack!' instead of 'area 267').
This commit is contained in:
Kelsi 2026-03-11 00:36:40 -07:00
parent eaf827668a
commit 7c5d688c00

View file

@ -2826,10 +2826,11 @@ void GameHandler::handlePacket(network::Packet& packet) {
// uint32 areaId // uint32 areaId
if (packet.getSize() - packet.getReadPos() >= 4) { if (packet.getSize() - packet.getReadPos() >= 4) {
uint32_t areaId = packet.readUInt32(); uint32_t areaId = packet.readUInt32();
char buf[128]; std::string areaName = getAreaName(areaId);
std::snprintf(buf, sizeof(buf), std::string msg = areaName.empty()
"A zone is under attack! (area %u)", areaId); ? std::string("A zone is under attack!")
addSystemChatMessage(buf); : (areaName + " is under attack!");
addSystemChatMessage(msg);
} }
break; break;
} }