mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
performance improve
This commit is contained in:
@@ -458,7 +458,7 @@ bool Engine::HasStrategy(std::string const name)
|
|||||||
|
|
||||||
void Engine::ProcessTriggers(bool minimal)
|
void Engine::ProcessTriggers(bool minimal)
|
||||||
{
|
{
|
||||||
std::map<Trigger*, Event> fires;
|
std::unordered_map<Trigger*, Event> fires;
|
||||||
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||||
{
|
{
|
||||||
TriggerNode* node = *i;
|
TriggerNode* node = *i;
|
||||||
@@ -614,6 +614,10 @@ bool Engine::ListenAndExecute(Action* action, Event event)
|
|||||||
|
|
||||||
void Engine::LogAction(char const* format, ...)
|
void Engine::LogAction(char const* format, ...)
|
||||||
{
|
{
|
||||||
|
Player* bot = botAI->GetBot();
|
||||||
|
if (sPlayerbotAIConfig->logInGroupOnly && (!bot->GetGroup() || !botAI->HasRealPlayerMaster()) && !testMode)
|
||||||
|
return;
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@@ -639,10 +643,6 @@ void Engine::LogAction(char const* format, ...)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Player* bot = botAI->GetBot();
|
|
||||||
if (sPlayerbotAIConfig->logInGroupOnly && (!bot->GetGroup() || !botAI->HasRealPlayerMaster()))
|
|
||||||
return;
|
|
||||||
|
|
||||||
LOG_DEBUG("playerbots", "{} {}", bot->GetName().c_str(), buf);
|
LOG_DEBUG("playerbots", "{} {}", bot->GetName().c_str(), buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user