Permalink
Browse files

Core/Pets: Fixed crashes introduced in 1496e4d

  • Loading branch information...
1 parent 4429830 commit cf1c1cf99222c8e1e260f14977c207306faff273 @Shauren Shauren committed Mar 21, 2013
@@ -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)

0 comments on commit cf1c1cf

Please sign in to comment.