mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Core/Players: fixed a possible crash when trying to send spell cooldowns for spells without a category entry
This commit is contained in:
@@ -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) });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user