mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-21 18:31:30 +00:00
More tweaks [skip ci]
This commit is contained in:
parent
78d63165cb
commit
0232a8a188
@ -2602,22 +2602,24 @@ void EntityList::ScanCloseMobs(std::unordered_map<uint16, Mob *> &close_mobs, Mo
|
|||||||
|
|
||||||
close_mobs.clear();
|
close_mobs.clear();
|
||||||
|
|
||||||
auto it = mob_list.begin();
|
for (auto &e : mob_list) {
|
||||||
while (it != mob_list.end()) {
|
auto mob = e.second;
|
||||||
Mob *mob = it->second;
|
|
||||||
|
|
||||||
if (!mob->IsNPC() && !mob->IsClient()) {
|
if (!mob->IsNPC() && !mob->IsClient()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
float distance = DistanceSquared(scanning_mob->GetPosition(), it->second->GetPosition());
|
if (mob->GetID() <= 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
float distance = DistanceSquared(scanning_mob->GetPosition(), mob->GetPosition());
|
||||||
if (distance <= scan_range) {
|
if (distance <= scan_range) {
|
||||||
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
||||||
}
|
}
|
||||||
else if (it->second->GetAggroRange() >= scan_range) {
|
else if (mob->GetAggroRange() >= scan_range) {
|
||||||
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
||||||
}
|
}
|
||||||
++it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LogAIScanClose("Close List Size [{}] for mob [{}]", close_mobs.size(), scanning_mob->GetCleanName());
|
LogAIScanClose("Close List Size [{}] for mob [{}]", close_mobs.size(), scanning_mob->GetCleanName());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user