Core/Pets: Fixed crashes introduced in 1496e4df84

This commit is contained in:
Shauren
2013-03-21 21:00:47 +01:00
parent 4429830ed7
commit cf1c1cf992
3 changed files with 5 additions and 7 deletions

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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)