Permalink
Browse files

Revert 0c55855 and properly fix missing pet action bar after reloadin…

…g UI (#1570)

* Revert "Core/Pet: Fix pet action bar after reloading UI (#1513)"

This reverts commit 0c55855.

* Core/Pet: Fix pet action bar after reloading UI

Credit to @dagochen -
#1513 (comment)
  • Loading branch information...
gashole authored and Zaffy committed Aug 5, 2017
1 parent 8c75057 commit c80cac6582d5f5020d07b3586f8fa0a528800d43
Showing with 6 additions and 17 deletions.
  1. +6 −4 src/game/MiscHandler.cpp
  2. +0 −12 src/game/PetAI.cpp
  3. +0 −1 src/game/PetAI.h
View
@@ -1506,10 +1506,12 @@ void WorldSession::HandleDismountOpcode(WorldPacket& /*recv_data*/)
void WorldSession::HandleRequestPetInfoOpcode(WorldPacket& /*recv_data */)
{
/*
DEBUG_LOG("WORLD: CMSG_REQUEST_PET_INFO");
recv_data.hexlike();
*/
DEBUG_LOG("WORLD: CMSG_REQUEST_PET_INFO");
if (_player->GetPet())
_player->PetSpellInitialize();
else if (_player->GetCharm())
_player->CharmSpellInitialize();
}
void WorldSession::HandleSetTaxiBenchmarkOpcode(WorldPacket& recv_data)
View
@@ -86,18 +86,6 @@ void PetAI::UpdateAI(const uint32 diff)
else
m_updateAlliesTimer -= diff;
// Prevent losing the pet action bar after reloading the user interface
if (owner && owner->GetTypeId() == TYPEID_PLAYER)
{
if (m_updatePetSpellTimer <= diff)
{
owner->ToPlayer()->PetSpellInitialize();
m_updatePetSpellTimer = 5 * IN_MILLISECONDS;
}
else
m_updatePetSpellTimer -= diff;
}
// i_pet.GetVictim() can't be used for check in case stop fighting, i_pet.GetVictim() clear at Unit death etc.
if (me->GetVictim() && me->GetVictim()->IsAlive())
{
View
@@ -60,7 +60,6 @@ class PetAI : public CreatureAI
bool inCombat;
std::set<uint64> m_AllySet;
uint32 m_updateAlliesTimer;
uint32 m_updatePetSpellTimer;
Unit* SelectNextTarget();
void HandleReturnMovement();

0 comments on commit c80cac6

Please sign in to comment.