From 7322c0bd83a010fec43ee905bb09df9352e36fca Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 21 Sep 2021 18:54:31 -0400 Subject: [PATCH] Scripts/Spells: fix Seaforium Blast script crash Port From (https://github.com/TrinityCore/TrinityCore/commit/6d3a11e1d1f849d1594a76f184ec2af6eb601fef) --- Source/Scripts/Spells/Generic.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Scripts/Spells/Generic.cs b/Source/Scripts/Spells/Generic.cs index 41dde9c67..47400951f 100644 --- a/Source/Scripts/Spells/Generic.cs +++ b/Source/Scripts/Spells/Generic.cs @@ -2550,19 +2550,19 @@ namespace Scripts.Spells.Generic public override bool Load() { // OriginalCaster is always available in Spell.prepare - return GetOriginalCaster().IsTypeId(TypeId.Player); + return GetGObjCaster().GetOwnerGUID().IsPlayer(); } void AchievementCredit(uint effIndex) { // but in effect handling OriginalCaster can become null - Unit originalCaster = GetOriginalCaster(); - if (originalCaster) + Unit owner = GetGObjCaster().GetOwner(); + if (owner != null) { GameObject go = GetHitGObj(); if (go) if (go.GetGoInfo().type == GameObjectTypes.DestructibleBuilding) - originalCaster.CastSpell(originalCaster, SpellIds.PlantChargesCreditAchievement, true); + owner.CastSpell(null, SpellIds.PlantChargesCreditAchievement, true); } }