fix(Core/Entities): Only add use to spell caster objects if cast succeeds. (#19601)

Init.
This commit is contained in:
Benjamin Jackson
2024-08-12 07:46:20 -04:00
committed by GitHub
parent 7b102f53f2
commit 3b2b8406a8

View File

@@ -1891,7 +1891,6 @@ void GameObject::Use(Unit* user)
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
spellId = info->spellcaster.spellId;
AddUse();
break;
}
case GAMEOBJECT_TYPE_MEETINGSTONE: //23
@@ -2067,7 +2066,10 @@ void GameObject::Use(Unit* user)
sOutdoorPvPMgr->HandleCustomSpell(player, spellId, this);
if (spellCaster)
spellCaster->CastSpell(user, spellInfo, triggered);
{
if ((spellCaster->CastSpell(user, spellInfo, triggered) == SPELL_CAST_OK) && GetGoType() == GAMEOBJECT_TYPE_SPELLCASTER)
AddUse();
}
else
CastSpell(user, spellId);
}