aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Spells
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2022-02-22 23:53:37 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-26 15:20:10 +0100
commitd86bc562cbc62a526f4c54ec70d2c134eb04c4c7 (patch)
treef952fd42752ae939e15606f5f8221a35c7740318 /src/server/scripts/Spells
parent1bb63f69ef12d572a34f6ed107a5d6008c7da5e2 (diff)
Scripts/Misc: Adjustments to previous fixes (#27821)
(cherry picked from commit 9ee6f4fb115d177d907ab48a9f9c5f39ba239046)
Diffstat (limited to 'src/server/scripts/Spells')
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 03e1cdf0a1b..b6983094847 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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