diff --git a/zone/attack.cpp b/zone/attack.cpp index 4ec8a8044..1c8c0da6e 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2583,9 +2583,6 @@ bool NPC::Death(Mob* killer_mob, int32 damage, uint16 spell, EQ::skills::SkillTy entity_list.RemoveFromAutoXTargets(this); - if (killer != nullptr && killer->GetUltimateOwner() && killer->GetUltimateOwner()->IsClient()) { - killer->GetUltimateOwner()->CastToClient()->ProcessXTargetAutoHaters(); - } uint16 emoteid = this->GetEmoteID(); auto corpse = new Corpse(this, &itemlist, GetNPCTypeID(), &NPCTypedata, level > 54 ? RuleI(NPC, MajorNPCCorpseDecayTimeMS) diff --git a/zone/client.cpp b/zone/client.cpp index 60f7212a8..dd45cbbc7 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7173,7 +7173,7 @@ void Client::OpenLFGuildWindow() bool Client::IsXTarget(const Mob *m) const { - if(!XTargettingAvailable() || !m || !m->IsValidXTarget()) + if(!XTargettingAvailable() || !m || (m->GetID() == 0)) return false; for(int i = 0; i < GetMaxXTargets(); ++i) @@ -7216,10 +7216,10 @@ void Client::UpdateClientXTarget(Client *c) // IT IS NOT SAFE TO CALL THIS IF IT'S NOT INITIAL AGGRO void Client::AddAutoXTarget(Mob *m, bool send) { + m_activeautohatermgr->increment_count(m); + if (!XTargettingAvailable() || !XTargetAutoAddHaters || IsXTarget(m)) return; - - m_activeautohatermgr->increment_count(m); for(int i = 0; i < GetMaxXTargets(); ++i) { @@ -7431,7 +7431,6 @@ void Client::ProcessXTargetAutoHaters() if (XTargets[i].ID != 0 && !GetXTargetAutoMgr()->contains_mob(XTargets[i].ID)) { XTargets[i].ID = 0; - XTargets[i].Name[0] = 0; XTargets[i].dirty = true; } diff --git a/zone/mob.cpp b/zone/mob.cpp index d754e27e2..e60e7a847 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -6650,7 +6650,3 @@ void Mob::SetBucket(std::string bucket_name, std::string bucket_value, std::stri std::string full_bucket_name = fmt::format("{}-{}", GetBucketKey(), bucket_name); DataBucket::SetData(full_bucket_name, bucket_value, expiration); } - -bool Mob::IsValidXTarget() const { - return (GetID() > 0 || !IsCorpse()); -} diff --git a/zone/mob.h b/zone/mob.h index e69802cc1..39cee5a96 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -1307,8 +1307,6 @@ public: std::string GetBucketRemaining(std::string bucket_name); void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration = ""); - bool IsValidXTarget() const; - #ifdef BOTS // Bots HealRotation methods bool IsHealRotationTarget() { return (m_target_of_heal_rotation.use_count() && m_target_of_heal_rotation.get()); }