mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-29 05:11:55 +01:00
Core/Pets: Fixed crashes introduced in 1496e4df84
This commit is contained in:
@@ -279,8 +279,7 @@ void TempSummon::RemoveFromWorld()
|
||||
Creature::RemoveFromWorld();
|
||||
}
|
||||
|
||||
Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner,
|
||||
bool isWorldObject)
|
||||
Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner, bool isWorldObject)
|
||||
: TempSummon(properties, owner, isWorldObject), m_owner(owner)
|
||||
{
|
||||
ASSERT(m_owner);
|
||||
|
||||
@@ -694,7 +694,7 @@ HappinessState Pet::GetHappinessState()
|
||||
|
||||
void Pet::Remove(PetSaveMode mode, bool returnreagent)
|
||||
{
|
||||
m_owner->RemovePet(this, mode, returnreagent);
|
||||
GetOwner()->RemovePet(this, mode, returnreagent);
|
||||
}
|
||||
|
||||
void Pet::GivePetXP(uint32 xp)
|
||||
@@ -1510,8 +1510,8 @@ bool Pet::learnSpell(uint32 spell_id)
|
||||
{
|
||||
WorldPacket data(SMSG_PET_LEARNED_SPELL, 4);
|
||||
data << uint32(spell_id);
|
||||
m_owner->GetSession()->SendPacket(&data);
|
||||
m_owner->PetSpellInitialize();
|
||||
GetOwner()->GetSession()->SendPacket(&data);
|
||||
GetOwner()->PetSpellInitialize();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1563,7 +1563,7 @@ bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
|
||||
{
|
||||
WorldPacket data(SMSG_PET_REMOVED_SPELL, 4);
|
||||
data << uint32(spell_id);
|
||||
m_owner->GetSession()->SendPacket(&data);
|
||||
GetOwner()->GetSession()->SendPacket(&data);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -147,7 +147,6 @@ class Pet : public Guardian
|
||||
Player* GetOwner() const;
|
||||
|
||||
protected:
|
||||
Player* m_owner;
|
||||
uint32 m_happinessTimer;
|
||||
PetType m_petType;
|
||||
int32 m_duration; // time until unsummon (used mostly for summoned guardians and not used for controlled pets)
|
||||
|
||||
Reference in New Issue
Block a user