Core/BattlePets: Improvements when enabling battle pets

Port From (https://github.com/TrinityCore/TrinityCore/commit/0a8f79ad5ad5afbf6a6aedc9ad46c3b774877b31)
This commit is contained in:
hondacrx
2021-12-16 13:10:24 -05:00
parent f7023cb290
commit da41af6279
5 changed files with 29 additions and 14 deletions
+4 -4
View File
@@ -5270,12 +5270,12 @@ namespace Game.Spells
if (effectHandleMode != SpellEffectHandleMode.HitTarget)
return;
if (!unitTarget || !unitTarget.IsTypeId(TypeId.Player))
if (unitTarget == null || !unitTarget.IsPlayer())
return;
Player plr = unitTarget.ToPlayer();
plr.AddPlayerFlag(PlayerFlags.PetBattlesUnlocked);
plr.GetSession().GetBattlePetMgr().UnlockSlot(0);
Player player = unitTarget.ToPlayer();
player.AddPlayerFlag(PlayerFlags.PetBattlesUnlocked);
player.GetSession().GetBattlePetMgr().UnlockSlot(BattlePetSlots.Slot0);
}
[SpellEffectHandler(SpellEffectName.LaunchQuestChoice)]