Core/Players: fixed a possible crash when trying to send spell cooldowns for spells without a category entry

This commit is contained in:
Ovahlord committed 2020-10-22 21:37:31 +02:00
1 parent a311740d3b
commit f8c35be20c
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -2636,7 +2636,7 @@ void Player::SendKnownSpells()
uint32 categoryCooldown = GetSpellHistory()->GetRemainingCategoryCooldown(spellInfo);
if (cooldown || categoryCooldown)
knownSpells.SpellHistoryEntries.push_back({ spellInfo->Id, 0, uint16(spellInfo->CategoryEntry->ID), int32(cooldown), int32(categoryCooldown) });
knownSpells.SpellHistoryEntries.push_back({ spellInfo->Id, 0, uint16(spellInfo->GetCategory()), int32(cooldown), int32(categoryCooldown) });
}
}
+2
View File
@@ -537,6 +537,8 @@ uint32 SpellHistory::GetRemainingCooldown(SpellInfo const* spellInfo, bool withC
end = catItr->second->CategoryEnd;
}
else
return 0;
Clock::time_point now = GameTime::GetGameTimeSystemPoint();
if (end < now)