Scripts/Misc: Adjustments to previous fixes (#27821)

(cherry picked from commit 9ee6f4fb11)
This commit is contained in:
offl
2022-02-22 23:53:37 +02:00
committed by Shauren
parent 1bb63f69ef
commit d86bc562cb
10 changed files with 31 additions and 47 deletions
+5 -6
View File
@@ -982,8 +982,8 @@ class spell_gen_consumption : public SpellScript
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
if (!caster || caster->GetTypeId() != TYPEID_UNIT)
Creature* caster = GetCaster()->ToCreature();
if (!caster)
return;
int32 damage = 0;
@@ -3684,10 +3684,9 @@ class spell_gen_whisper_to_controller : public SpellScript
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Unit* caster = GetCaster())
if (TempSummon* casterSummon = caster->ToTempSummon())
if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
if (TempSummon* casterSummon = GetCaster()->ToTempSummon())
if (Player* target = casterSummon->GetSummonerUnit()->ToPlayer())
casterSummon->Unit::Whisper(uint32(GetEffectValue()), target, false);
}
void Register() override