[Crash] Add validation to RemoveXTarget (#4324)

This commit is contained in:
Chris Miles 2024-05-24 20:54:10 -05:00 committed by GitHub
parent fc9ef2fb7b
commit 98b137154a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6994,6 +6994,10 @@ void Client::AddAutoXTarget(Mob *m, bool send)
void Client::RemoveXTarget(Mob *m, bool OnlyAutoSlots)
{
if (!XTargettingAvailable() || !m || !m_activeautohatermgr) {
return;
}
m_activeautohatermgr->decrement_count(m);
// now we may need to clean up our CurrentTargetNPC entries
for (int i = 0; i < GetMaxXTargets(); ++i) {