fix(Core/Pets): fixed crash happening when current pet is forcibly removed (#10025)

This commit is contained in:
Kargatum
2022-01-10 19:19:43 +07:00
committed by GitHub
parent b2df4aa970
commit c1ebda66ba
8 changed files with 50 additions and 10 deletions

View File

@@ -2252,6 +2252,8 @@ bool Pet::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, uint32
if (!InitEntry(Entry))
return false;
// Force regen flag for player pets, just like we do for players themselves
SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);
SetSheath(SHEATH_STATE_MELEE);
return true;