1
0

Fix a crash trying to unlock a spell for a player with a recast timer when the spell data is null

This commit is contained in:
Emagi 2025-05-30 10:27:10 -04:00
parent c4fe6e7230
commit cde778bb1a

View File

@ -2738,7 +2738,7 @@ void Player::UnlockSpell(Spell* spell) {
MSpellsBook.writelock(__FUNCTION__, __LINE__);
for (itr = spells.begin(); itr != spells.end(); itr++) {
spell2 = *itr;
if (spell2->spell_id == spell->GetSpellID() || (spell->GetSpellData()->linked_timer > 0 && spell->GetSpellData()->linked_timer == spell2->timer))
if (spell2->spell_id == spell->GetSpellID() || (spell->GetSpellData() && spell->GetSpellData()->linked_timer > 0 && spell->GetSpellData()->linked_timer == spell2->timer))
{
spell2->in_use = false;
spell2->recast_available = 0;