mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Cleanup] use std::make_unique (#1259)
* Convert common/eq_limits.cpp to use make_unique * Convert common/net/console_server.cpp to use make_unique * Convert common/net/servertalk_client_connection.cpp to use make_unique * Convert common/net/servertalk_legacy_client_connection.cpp to use make_unique * Convert common/net/servertalk_server.cpp to use make_unique * Convert common/net/websocket_server.cpp to use make_unique * Convert common/net/websocket_server_connection.cpp to use make_unique * Convert common/shareddb.cpp to use make_unique * Convert eqlaunch/worldserver.cpp to use make_unique * Convert loginserver/server_manager.cpp to use make_unique * Convert loginserver/world_server.cpp to use make_unique * Convert queryserv/worldserver.cpp to use make_unique * Convert ucs/worldserver.cpp to use make_unique * Convert world/clientlist.cpp to use make_unique * Convert world/expedition.cpp to use make_unique * Convert world/launcher_link.cpp to use make_unique * Convert world/login_server.cpp to use make_unique * Convert world/main.cpp to use make_unique * Convert world/ucs.cpp to use make_unique * Convert world/web_interface.cpp to use make_unique * Convert world/zonelist.cpp to use make_unique * Convert world/zoneserver.cpp to use make_unique * Convert zone/client.cpp to use make_unique * Convert zone/corpse.cpp to use make_unique * Convert zone/dynamiczone.cpp to use make_unique * Convert zone/expedition.cpp to use make_unique * Convert zone/main.cpp to use make_unique * Convert zone/mob_ai.cpp to use make_unique * Convert zone/mob_movement_manager.cpp to use make_unique * Convert zone/pathfinder_nav_mesh.cpp to use make_unique * Convert zone/worldserver.cpp to use make_unique
This commit is contained in:
committed by
GitHub
parent
fa9478ac44
commit
7a46a6595c
+9
-9
@@ -435,13 +435,13 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
time_until_can_move = 0;
|
||||
|
||||
pAIControlled = true;
|
||||
AI_think_timer = std::unique_ptr<Timer>(new Timer(AIthink_duration));
|
||||
AI_think_timer = std::make_unique<Timer>(AIthink_duration);
|
||||
AI_think_timer->Trigger();
|
||||
|
||||
AI_walking_timer = std::unique_ptr<Timer>(new Timer(0));
|
||||
AI_movement_timer = std::unique_ptr<Timer>(new Timer(AImovement_duration));
|
||||
AI_target_check_timer = std::unique_ptr<Timer>(new Timer(AItarget_check_duration));
|
||||
AI_feign_remember_timer = std::unique_ptr<Timer>(new Timer(AIfeignremember_delay));
|
||||
AI_walking_timer = std::make_unique<Timer>(0);
|
||||
AI_movement_timer = std::make_unique<Timer>(AImovement_duration);
|
||||
AI_target_check_timer = std::make_unique<Timer>(AItarget_check_duration);
|
||||
AI_feign_remember_timer = std::make_unique<Timer>(AIfeignremember_delay);
|
||||
AI_scan_door_open_timer = std::make_unique<Timer>(AI_scan_door_open_interval);
|
||||
|
||||
if (GetBodyType() == BT_Animal && !RuleB(NPC, AnimalsOpenDoors)) {
|
||||
@@ -453,9 +453,9 @@ void Mob::AI_Start(uint32 iMoveDelay) {
|
||||
}
|
||||
|
||||
if (CastToNPC()->WillAggroNPCs())
|
||||
AI_scan_area_timer = std::unique_ptr<Timer>(new Timer(RandomTimer(RuleI(NPC, NPCToNPCAggroTimerMin), RuleI(NPC, NPCToNPCAggroTimerMax))));
|
||||
AI_scan_area_timer = std::make_unique<Timer>(RandomTimer(RuleI(NPC, NPCToNPCAggroTimerMin), RuleI(NPC, NPCToNPCAggroTimerMax)));
|
||||
|
||||
AI_check_signal_timer = std::unique_ptr<Timer>(new Timer(AI_check_signal_timer_delay));
|
||||
AI_check_signal_timer = std::make_unique<Timer>(AI_check_signal_timer_delay);
|
||||
|
||||
|
||||
if (GetAggroRange() == 0)
|
||||
@@ -488,10 +488,10 @@ void NPC::AI_Start(uint32 iMoveDelay) {
|
||||
return;
|
||||
|
||||
if (AIspells.empty()) {
|
||||
AIautocastspell_timer = std::unique_ptr<Timer>(new Timer(1000));
|
||||
AIautocastspell_timer = std::make_unique<Timer>(1000);
|
||||
AIautocastspell_timer->Disable();
|
||||
} else {
|
||||
AIautocastspell_timer = std::unique_ptr<Timer>(new Timer(500));
|
||||
AIautocastspell_timer = std::make_unique<Timer>(500);
|
||||
AIautocastspell_timer->Start(RandomTimer(0, 300), false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user