mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
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:
parent
eaf827668a
commit
7c5d688c00
1 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue