[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:
Chris Miles
2024-11-08 17:48:39 -06:00
committed by GitHub
parent 1ce51ca3b0
commit 0ea47fadee
7 changed files with 42 additions and 47 deletions
+5 -1
View File
@@ -5013,7 +5013,11 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) {
SetMoving(!(cy == m_Position.y && cx == m_Position.x));
CheckClientToNpcAggroTimer();
CheckScanCloseMobsMovingTimer();
if (m_mob_check_moving_timer.Check()) {
CheckScanCloseMobsMovingTimer();
}
CheckSendBulkClientPositionUpdate();
int32 new_animation = ppu->animation;