mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Implement the PC/NPC only flag
This commit is contained in:
+9
-1
@@ -4655,7 +4655,7 @@ Mob *EntityList::GetClosestMobByBodyType(Mob *sender, bodyType BodyType)
|
||||
return ClosestMob;
|
||||
}
|
||||
|
||||
void EntityList::GetTargetsForConeArea(Mob *start, float min_radius, float radius, float height, std::list<Mob*> &m_list)
|
||||
void EntityList::GetTargetsForConeArea(Mob *start, float min_radius, float radius, float height, int pcnpc, std::list<Mob*> &m_list)
|
||||
{
|
||||
auto it = mob_list.begin();
|
||||
while (it != mob_list.end()) {
|
||||
@@ -4664,6 +4664,14 @@ void EntityList::GetTargetsForConeArea(Mob *start, float min_radius, float radiu
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
// check PC/NPC only flag 1 = PCs, 2 = NPCs
|
||||
if (pcnpc == 1 && !ptr->IsClient() && !ptr->IsMerc()) {
|
||||
++it;
|
||||
continue;
|
||||
} else if (pcnpc == 2 && (ptr->IsClient() || ptr->IsMerc())) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
float x_diff = ptr->GetX() - start->GetX();
|
||||
float y_diff = ptr->GetY() - start->GetY();
|
||||
float z_diff = ptr->GetZ() - start->GetZ();
|
||||
|
||||
Reference in New Issue
Block a user