diff --git a/zone/attack.cpp b/zone/attack.cpp index d51f915b2..7dcdcf353 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1486,6 +1486,7 @@ void Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillType attack_ entity_list.RemoveFromTargets(this); hate_list.RemoveEnt(this); + RemoveAutoXTargets(); //remove ourself from all proximities diff --git a/zone/client.cpp b/zone/client.cpp index 04f15841c..60b5df5aa 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -6990,6 +6990,22 @@ void Client::RemoveGroupXTargets() } } +void Client::RemoveAutoXTargets() +{ + if(!XTargettingAvailable()) + return; + + for(int i = 0; i < GetMaxXTargets(); ++i) + { + if(XTargets[i].Type == Auto) + { + XTargets[i].ID = 0; + XTargets[i].Name[0] = 0; + SendXTargetPacket(i, nullptr); + } + } +} + void Client::ShowXTargets(Client *c) { if(!c) diff --git a/zone/client.h b/zone/client.h index edbd7b445..a37da01f4 100644 --- a/zone/client.h +++ b/zone/client.h @@ -1095,6 +1095,7 @@ public: void RemoveXTarget(Mob *m, bool OnlyAutoSlots); void SendXTargetPacket(uint32 Slot, Mob *m); void RemoveGroupXTargets(); + void RemoveAutoXTargets(); void ShowXTargets(Client *c); void InitializeMercInfo(); bool CheckCanHireMerc(Mob* merchant, uint32 template_id);