mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-09 22:20:24 +00:00
Unify / streamline scanning logic calls, do a manual scan on enter and cleanup logging
This commit is contained in:
+1
-22
@@ -256,28 +256,7 @@ bool Client::Process() {
|
||||
* Used in aggro checks
|
||||
*/
|
||||
if (mob_close_scan_timer.Check()) {
|
||||
close_mobs.clear();
|
||||
|
||||
float scan_range = RuleI(Range, MobCloseScanDistance) * RuleI(Range, MobCloseScanDistance);
|
||||
auto &mob_list = entity_list.GetMobList();
|
||||
|
||||
for (auto itr : mob_list) {
|
||||
Mob *mob = itr.second;
|
||||
float distance = DistanceSquared(m_Position, mob->GetPosition());
|
||||
|
||||
if (mob->GetID() <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mob->IsNPC() || mob->IsClient()) {
|
||||
if (distance <= scan_range) {
|
||||
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
||||
}
|
||||
else if ((mob->GetAggroRange() * mob->GetAggroRange()) > scan_range) {
|
||||
close_mobs.insert(std::pair<uint16, Mob *>(mob->GetID(), mob));
|
||||
}
|
||||
}
|
||||
}
|
||||
entity_list.ScanCloseMobs(close_mobs, this);
|
||||
}
|
||||
|
||||
bool may_use_attacks = false;
|
||||
|
||||
Reference in New Issue
Block a user