Skip to content

Commit

Permalink
Revert 0c55855 and properly fix missing pet action bar after reloadin…
Browse files Browse the repository at this point in the history
…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 c80cac6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
10 changes: 6 additions & 4 deletions src/game/MiscHandler.cpp
Expand Up @@ -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)
Expand Down
12 changes: 0 additions & 12 deletions src/game/PetAI.cpp
Expand Up @@ -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())
{
Expand Down
1 change: 0 additions & 1 deletion src/game/PetAI.h
Expand Up @@ -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();
Expand Down

0 comments on commit c80cac6

Please sign in to comment.