Core/Spells: fixed sending cooldown data in SMSG_SEND_KNOWN_SPELLS

This commit is contained in:
Ovahlord committed 2021-03-08 21:59:55 +01:00
1 parent e34c38cef4
commit fe7816bb71
4 files changed
+24 -30

No files matched your search

+2 -8
View File
@@ -2627,16 +2627,10 @@ void Player::SendKnownSpells()
knownSpells.KnownSpells.push_back(spell.first);
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell.first))
{
uint32 cooldown = GetSpellHistory()->GetRemainingCooldown(spellInfo, false);
uint32 categoryCooldown = GetSpellHistory()->GetRemainingCategoryCooldown(spellInfo);
if (cooldown || categoryCooldown)
knownSpells.SpellHistoryEntries.push_back({ spellInfo->Id, 0, uint16(spellInfo->GetCategory()), int32(cooldown), int32(categoryCooldown) });
}
}
GetSpellHistory()->WriteSpellHistoryEntries<Player>(knownSpells.SpellHistoryEntries);
SendDirectMessage(knownSpells.Write());
}