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

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

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) });
}
}

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)