Core/BattlePets: Journal lock improvements

Port From (https://github.com/TrinityCore/TrinityCore/commit/895367e69fac542ea00079ee1405228d9f150898)
This commit is contained in:
hondacrx
2021-11-23 14:01:16 -05:00
parent 1f6e2e22f9
commit 751f4dd8b2
6 changed files with 78 additions and 9 deletions
+12
View File
@@ -30,6 +30,15 @@ namespace Game
GetBattlePetMgr().SendJournal();
}
[WorldPacketHandler(ClientOpcodes.BattlePetRequestJournalLock)]
void HandleBattlePetRequestJournalLock(BattlePetRequestJournalLock battlePetRequestJournalLock)
{
GetBattlePetMgr().SendJournalLockStatus();
if (GetBattlePetMgr().HasJournalLock())
GetBattlePetMgr().SendJournal();
}
[WorldPacketHandler(ClientOpcodes.BattlePetSetBattleSlot)]
void HandleBattlePetSetBattleSlot(BattlePetSetBattleSlot battlePetSetBattleSlot)
{
@@ -57,6 +66,9 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.BattlePetSetFlags)]
void HandleBattlePetSetFlags(BattlePetSetFlags battlePetSetFlags)
{
if (!GetBattlePetMgr().HasJournalLock())
return;
var pet = GetBattlePetMgr().GetPet(battlePetSetFlags.PetGuid);
if (pet != null)
{
+1 -2
View File
@@ -784,8 +784,7 @@ namespace Game
pCurrChar.SetGuildLevel(0);
}
// TODO: Move this to BattlePetMgr::SendJournalLock() just to have all packets in one file
SendPacket(new BattlePetJournalLockAcquired());
pCurrChar.GetSession().GetBattlePetMgr().SendJournalLockStatus();
pCurrChar.SendInitialPacketsBeforeAddToMap();