[Pets] Fix errors in sync with client of sit/stand (#4245)

* [Pets] Fix errors in sync with client of sit/stand

* Forgot bot.h
This commit is contained in:
Paul Coene
2024-04-15 05:59:36 -04:00
committed by GitHub
parent d6b5a9d343
commit 41c5369c18
5 changed files with 37 additions and 19 deletions
+5 -5
View File
@@ -4058,7 +4058,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
Mob *owner = GetOwner();
if (owner && owner->IsClient()) {
if (GetPetOrder() == SPO_Sit) {
SetPetOrder(SPO_Follow);
SetPetOrder(GetPreviousPetOrder());
}
// fix GUI sit button to be unpressed and stop sitting regen
owner->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
@@ -4088,11 +4088,11 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
!pet->IsHeld()
) {
LogAggro("Sending pet [{}] into battle due to attack", pet->GetName());
if (IsClient()) {
// if pet was sitting his new mode is follow
// following after the battle (live verified)
if (IsClient() && !pet->IsPetStop()) {
// if pet was sitting his new mode is previous setting of
// follow or guard after the battle (live verified)
if (pet->GetPetOrder() == SPO_Sit) {
pet->SetPetOrder(SPO_Follow);
pet->SetPetOrder(pet->GetPreviousPetOrder());
}
// fix GUI sit button to be unpressed and stop sitting regen