Scripts/Spells: fix Seaforium Blast script crash
Port From (https://github.com/TrinityCore/TrinityCore/commit/6d3a11e1d1f849d1594a76f184ec2af6eb601fef)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user