mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Performance] Improvements to ScanCloseMobs logic (#4534)
* [Performance] Minor improvements to ScanCloseMobs * Remove timer checks one level up to reduce branching * Reserve memory in m_close_mobs to avoid frequent re-allocations if not already reserved.
This commit is contained in:
+7
-2
@@ -601,8 +601,13 @@ bool NPC::Process()
|
||||
DepopSwarmPets();
|
||||
}
|
||||
|
||||
ScanCloseMobProcess();
|
||||
CheckScanCloseMobsMovingTimer();
|
||||
if (m_scan_close_mobs_timer.Check()) {
|
||||
entity_list.ScanCloseMobs(this);
|
||||
}
|
||||
|
||||
if (m_mob_check_moving_timer.Check()) {
|
||||
CheckScanCloseMobsMovingTimer();
|
||||
}
|
||||
|
||||
if (hp_regen_per_second > 0 && hp_regen_per_second_timer.Check()) {
|
||||
if (GetHP() < GetMaxHP()) {
|
||||
|
||||
Reference in New Issue
Block a user