mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 15:00:25 +00:00
[BugFix] Remove detection of client pets from Sense[Summoned|Undead|Animal] spells (#1601)
* Remove detection of client pets from Sense[Summoned|Undead|Animal] * Use IsPetOwnerClient() function instead of individual checks * Add option to exclude client pets from GetClosestMobByBodyType * Add parameter Co-authored-by: Noudess <noudess@gmail.com>
This commit is contained in:
+5
-1
@@ -5146,7 +5146,7 @@ void EntityList::ExpeditionWarning(uint32 minutes_left)
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
Mob *EntityList::GetClosestMobByBodyType(Mob *sender, bodyType BodyType)
|
||||
Mob *EntityList::GetClosestMobByBodyType(Mob *sender, bodyType BodyType, bool skip_client_pets)
|
||||
{
|
||||
|
||||
if (!sender)
|
||||
@@ -5163,6 +5163,10 @@ Mob *EntityList::GetClosestMobByBodyType(Mob *sender, bodyType BodyType)
|
||||
if (CurrentMob->GetBodyType() != BodyType)
|
||||
continue;
|
||||
|
||||
// Do not detect client pets
|
||||
if (skip_client_pets && CurrentMob->IsPet() && CurrentMob->IsPetOwnerClient())
|
||||
continue;
|
||||
|
||||
CurrentDistance = ((CurrentMob->GetY() - sender->GetY()) * (CurrentMob->GetY() - sender->GetY())) +
|
||||
((CurrentMob->GetX() - sender->GetX()) * (CurrentMob->GetX() - sender->GetX()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user