Skip to content

Commit

Permalink
Core/Pets: Fixed crashes introduced in 1496e4d
Browse files Browse the repository at this point in the history
  • Loading branch information
Shauren committed Mar 21, 2013
1 parent 4429830 commit cf1c1cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/server/game/Entities/Creature/TemporarySummon.cpp
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions src/server/game/Entities/Pet/Pet.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion src/server/game/Entities/Pet/Pet.h
Expand Up @@ -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)
Expand Down

0 comments on commit cf1c1cf

Please sign in to comment.