fix(Player/SpellQueue): bandaid crashfix (#21103)

This commit is contained in:
Jelle Meeus 2025-01-10 23:38:24 +01:00 committed by GitHub
parent e941d43a0a
commit 5bc20a184d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2333,6 +2333,12 @@ void Player::ProcessSpellQueue()
{
PendingSpellCastRequest& request = SpellQueue.front(); // Peek at the first spell
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(request.spellId);
if (!spellInfo)
{
LOG_ERROR("entities.player", "Player::ProcessSpellQueue: Invalid spell {}", request.spellId);
SpellQueue.clear();
break;
}
if (CanExecutePendingSpellCastRequest(spellInfo))
{
ExecuteOrCancelSpellCastRequest(&request);