Skip to content

Commit ef945e6

Browse files
authored
[Fix] Fix zone crash when attempting to add a disappearing client to hate list. (#4782)
1 parent 9528c1e commit ef945e6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

zone/attack.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -3041,9 +3041,15 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
30413041
if (!other)
30423042
return;
30433043

3044+
if (other->IsDestroying())
3045+
return;
3046+
30443047
if (other == this)
30453048
return;
30463049

3050+
if (other->IsClient() && (other->CastToClient()->IsZoning() || other->CastToClient()->Connected() == false))
3051+
return;
3052+
30473053
if (other->IsTrap())
30483054
return;
30493055

zone/mob.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ Mob::Mob(
131131
m_scan_close_mobs_timer(6000),
132132
m_see_close_mobs_timer(1000),
133133
m_mob_check_moving_timer(1000),
134-
bot_attack_flag_timer(10000)
134+
bot_attack_flag_timer(10000),
135+
m_destroying(false)
135136
{
136137
mMovementManager = &MobMovementManager::Get();
137138
mMovementManager->AddMob(this);
@@ -531,6 +532,8 @@ Mob::Mob(
531532

532533
Mob::~Mob()
533534
{
535+
m_destroying = true;
536+
534537
entity_list.RemoveMobFromCloseLists(this);
535538
m_close_mobs.clear();
536539

zone/mob.h

+2
Original file line numberDiff line numberDiff line change
@@ -1510,6 +1510,7 @@ class Mob : public Entity {
15101510

15111511
void ClearDataBucketCache();
15121512
bool IsGuildmaster() const;
1513+
bool IsDestroying() const { return m_destroying; }
15131514

15141515
protected:
15151516
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 @@ class Mob : public Entity {
19321933
EQ::InventoryProfile m_inv;
19331934
std::shared_ptr<HealRotation> m_target_of_heal_rotation;
19341935
bool m_manual_follow;
1936+
bool m_destroying;
19351937

19361938
void SetHeroicStrBonuses(StatBonuses* n);
19371939
void SetHeroicStaBonuses(StatBonuses* n);

0 commit comments

Comments
 (0)