mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: load skill DBCs on login and handle loot slot changes
- Load SkillLine.dbc and SkillLineAbility.dbc during SMSG_INITIAL_SPELLS so isProfessionSpell() works immediately without visiting a trainer - Implement SMSG_LOOT_SLOT_CHANGED handler to remove items taken by other players in group loot, keeping the loot window in sync
This commit is contained in:
parent
7b03d5363b
commit
9aed192503
1 changed files with 17 additions and 3 deletions
|
|
@ -2849,10 +2849,19 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case Opcode::SMSG_LOOT_SLOT_CHANGED:
|
||||
// uint64 objectGuid + uint32 slot + ... — consume
|
||||
packet.setReadPos(packet.getSize());
|
||||
case Opcode::SMSG_LOOT_SLOT_CHANGED: {
|
||||
// uint8 slotIndex — another player took the item from this slot in group loot
|
||||
if (packet.getSize() - packet.getReadPos() >= 1) {
|
||||
uint8_t slotIndex = packet.readUInt8();
|
||||
for (auto it = currentLoot.items.begin(); it != currentLoot.items.end(); ++it) {
|
||||
if (it->slotIndex == slotIndex) {
|
||||
currentLoot.items.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// ---- Spell log miss ----
|
||||
case Opcode::SMSG_SPELLLOGMISS: {
|
||||
|
|
@ -17966,6 +17975,11 @@ void GameHandler::handleInitialSpells(network::Packet& packet) {
|
|||
}
|
||||
}
|
||||
|
||||
// Pre-load skill line DBCs so isProfessionSpell() works immediately
|
||||
// (not just after opening a trainer window)
|
||||
loadSkillLineDbc();
|
||||
loadSkillLineAbilityDbc();
|
||||
|
||||
LOG_INFO("Learned ", knownSpells.size(), " spells");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue