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
if (packet.getSize() - packet.getReadPos() >= 4) {
uint32_t areaId = packet.readUInt32();
char buf[128];
std::snprintf(buf, sizeof(buf),
"A zone is under attack! (area %u)", areaId);
addSystemChatMessage(buf);
std::string areaName = getAreaName(areaId);
std::string msg = areaName.empty()
? std::string("A zone is under attack!")
: (areaName + " is under attack!");
addSystemChatMessage(msg);
}
break;
}