mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-28 17:37:18 +00:00
(Performance) Rate limit the rate in which signals are processed for NPC's
This commit is contained in:
@@ -159,6 +159,7 @@ enum { //timer settings, all in milliseconds
|
||||
AItarget_check_duration = 500,
|
||||
AIClientScanarea_delay = 750, //used in REVERSE_AGGRO
|
||||
AIassistcheck_delay = 3000, //now often a fighting NPC will yell for help
|
||||
AI_check_signal_timer_delay = 500, // How often EVENT_SIGNAL checks are processed
|
||||
ClientProximity_interval = 150,
|
||||
CombatEventTimer_expire = 12000,
|
||||
Tribute_duration = 600000,
|
||||
|
||||
@@ -1262,6 +1262,7 @@ protected:
|
||||
std::unique_ptr<Timer> AIscanarea_timer;
|
||||
std::unique_ptr<Timer> AIwalking_timer;
|
||||
std::unique_ptr<Timer> AIfeignremember_timer;
|
||||
std::unique_ptr<Timer> AI_check_signal_timer;
|
||||
uint32 pLastFightingDelayMoving;
|
||||
HateList hate_list;
|
||||
std::set<uint32> feign_memory_list;
|
||||
|
||||
+6
-1
@@ -429,6 +429,8 @@ void Mob::AI_Init()
|
||||
AItarget_check_timer.reset(nullptr);
|
||||
AIfeignremember_timer.reset(nullptr);
|
||||
AIscanarea_timer.reset(nullptr);
|
||||
AI_check_signal_timer.reset(nullptr);
|
||||
|
||||
minLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMin);
|
||||
maxLastFightingDelayMoving = RuleI(NPC, LastFightingDelayMovingMax);
|
||||
|
||||
@@ -479,6 +481,8 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
AItarget_check_timer = std::unique_ptr<Timer>(new Timer(AItarget_check_duration));
|
||||
AIfeignremember_timer = std::unique_ptr<Timer>(new Timer(AIfeignremember_delay));
|
||||
AIscanarea_timer = std::unique_ptr<Timer>(new Timer(AIscanarea_delay));
|
||||
AI_check_signal_timer = std::unique_ptr<Timer>(new Timer(AI_check_signal_timer_delay));
|
||||
|
||||
#ifdef REVERSE_AGGRO
|
||||
if(IsNPC() && !CastToNPC()->WillAggroNPCs())
|
||||
AIscanarea_timer->Disable();
|
||||
@@ -544,6 +548,7 @@ void Mob::AI_Stop() {
|
||||
AItarget_check_timer.reset(nullptr);
|
||||
AIscanarea_timer.reset(nullptr);
|
||||
AIfeignremember_timer.reset(nullptr);
|
||||
AI_check_signal_timer.reset(nullptr);
|
||||
|
||||
hate_list.WipeHateList();
|
||||
}
|
||||
@@ -998,7 +1003,7 @@ void Mob::AI_Process() {
|
||||
}
|
||||
|
||||
// trigger EVENT_SIGNAL if required
|
||||
if(IsNPC()) {
|
||||
if (AI_check_signal_timer->Check() && IsNPC()) {
|
||||
CastToNPC()->CheckSignal();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user