[Fix] Fix zone crash when attempting to add a disappearing client to hate list. (#4782)

This commit is contained in:
zimp-wow 2025-03-19 16:26:54 -05:00 committed by GitHub
parent 9528c1e7fc
commit ef945e6e99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -3041,9 +3041,15 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
if (!other)
return;
if (other->IsDestroying())
return;
if (other == this)
return;
if (other->IsClient() && (other->CastToClient()->IsZoning() || other->CastToClient()->Connected() == false))
return;
if (other->IsTrap())
return;

View File

@ -131,7 +131,8 @@ Mob::Mob(
m_scan_close_mobs_timer(6000),
m_see_close_mobs_timer(1000),
m_mob_check_moving_timer(1000),
bot_attack_flag_timer(10000)
bot_attack_flag_timer(10000),
m_destroying(false)
{
mMovementManager = &MobMovementManager::Get();
mMovementManager->AddMob(this);
@ -531,6 +532,8 @@ Mob::Mob(
Mob::~Mob()
{
m_destroying = true;
entity_list.RemoveMobFromCloseLists(this);
m_close_mobs.clear();

View File

@ -1510,6 +1510,7 @@ public:
void ClearDataBucketCache();
bool IsGuildmaster() const;
bool IsDestroying() const { return m_destroying; }
protected:
void CommonDamage(Mob* other, int64 &damage, const uint16 spell_id, const EQ::skills::SkillType attack_skill, bool &avoidable, const int8 buffslot, const bool iBuffTic, eSpecialAttacks specal = eSpecialAttacks::None);
@ -1932,6 +1933,7 @@ private:
EQ::InventoryProfile m_inv;
std::shared_ptr<HealRotation> m_target_of_heal_rotation;
bool m_manual_follow;
bool m_destroying;
void SetHeroicStrBonuses(StatBonuses* n);
void SetHeroicStaBonuses(StatBonuses* n);