Core/BattlePets: Misc fixes
Port From (https://github.com/TrinityCore/TrinityCore/commit/446997cdf2bf24163141d7dcaa80bb6ef891f933)
This commit is contained in:
@@ -34,15 +34,20 @@ namespace Game
|
||||
Unit pet = ObjectAccessor.GetCreatureOrPetOrVehicle(GetPlayer(), packet.CritterGUID);
|
||||
if (!pet)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "Vanitypet {0} does not exist - player '{1}' ({2} / account: {3}) attempted to dismiss it (possibly lagged out)",
|
||||
Log.outDebug(LogFilter.Network, "Critter {0} does not exist - player '{1}' ({2} / account: {3}) attempted to dismiss it (possibly lagged out)",
|
||||
packet.CritterGUID.ToString(), GetPlayer().GetName(), GetPlayer().GetGUID().ToString(), GetAccountId());
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().GetCritterGUID() == pet.GetGUID())
|
||||
{
|
||||
if (pet.IsTypeId(TypeId.Unit) && pet.ToCreature().IsSummon())
|
||||
if (pet.IsCreature() && pet.IsSummon())
|
||||
{
|
||||
if (!_player.GetSummonedBattlePetGUID().IsEmpty() && _player.GetSummonedBattlePetGUID() == pet.GetBattlePetCompanionGUID())
|
||||
_player.SetBattlePetData(null);
|
||||
|
||||
pet.ToTempSummon().UnSummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user