Core/Scripts: filter out corpses from Sindragosa's Fury targetlist

- This would incur in a crash after attempting to convert the Corpse object into Player

Closes #19227
Closes #19862
This commit is contained in:
ariel-
2017-06-08 12:33:10 -03:00
committed by Aokromes
parent 4b073c7354
commit 307cc1e36f

View File

@@ -1060,13 +1060,6 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
{
PrepareSpellScript(spell_sindragosa_s_fury_SpellScript);
public:
spell_sindragosa_s_fury_SpellScript()
{
_targetCount = 0;
}
private:
bool Load() override
{
// This script should execute only in Icecrown Citadel
@@ -1094,8 +1087,8 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
{
targets.remove_if([](WorldObject* obj) -> bool
{
// SPELL_ATTR3_ONLY_TARGET_PLAYERS present on the spell, we can safely cast to Player
return ASSERT_NOTNULL(obj->ToPlayer())->IsGameMaster();
// SPELL_ATTR3_ONLY_TARGET_PLAYERS present on the spell, we can safely cast to Player if not corpse
return obj->GetTypeId() == TYPEID_CORPSE || ASSERT_NOTNULL(obj->ToPlayer())->IsGameMaster();
});
_targetCount = targets.size();
@@ -1133,7 +1126,7 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
OnEffectHitTarget += SpellEffectFn(spell_sindragosa_s_fury_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
uint32 _targetCount;
uint32 _targetCount = 0;
};
SpellScript* GetSpellScript() const override