feat: show equipment set name in save confirmation

SMSG_EQUIPMENT_SET_SAVED: parse the set index and GUID, look up the
matching set name from equipmentSets_, and show
"Equipment set \"<name>\" saved." instead of the generic message.
Falls back to "Equipment set saved." when the set is not yet in the
local cache (e.g. first save before SMSG_EQUIPMENT_SET_LIST arrives).
This commit is contained in:
Kelsi 2026-03-13 07:31:44 -07:00
parent d2f2d6db72
commit 90c88d7ecd

View file

@ -3847,11 +3847,27 @@ void GameHandler::handlePacket(network::Packet& packet) {
}
break;
}
case Opcode::SMSG_EQUIPMENT_SET_SAVED:
case Opcode::SMSG_EQUIPMENT_SET_SAVED: {
// uint32 setIndex + uint64 guid — equipment set was successfully saved
addSystemChatMessage("Equipment set saved.");
std::string setName;
if (packet.getSize() - packet.getReadPos() >= 12) {
uint32_t setIndex = packet.readUInt32();
uint64_t setGuid = packet.readUInt64();
for (const auto& es : equipmentSets_) {
if (es.setGuid == setGuid ||
(es.setGuid == 0 && es.setId == setIndex)) {
setName = es.name;
break;
}
}
(void)setIndex;
}
addSystemChatMessage(setName.empty()
? std::string("Equipment set saved.")
: "Equipment set \"" + setName + "\" saved.");
LOG_DEBUG("Equipment set saved");
break;
}
case Opcode::SMSG_PERIODICAURALOG: {
// WotLK: packed_guid victim + packed_guid caster + uint32 spellId + uint32 count + effects
// TBC: full uint64 victim + uint64 caster + uint32 spellId + uint32 count + effects