mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
@@ -470,7 +470,7 @@ bool Engine::HasStrategy(std::string const name)
|
||||
|
||||
void Engine::ProcessTriggers(bool minimal)
|
||||
{
|
||||
// std::unordered_map<Trigger*, Event> fires;
|
||||
std::unordered_map<Trigger*, Event> fires;
|
||||
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||
{
|
||||
TriggerNode* node = *i;
|
||||
@@ -486,7 +486,10 @@ void Engine::ProcessTriggers(bool minimal)
|
||||
|
||||
if (!trigger)
|
||||
continue;
|
||||
|
||||
|
||||
if (fires.find(trigger) != fires.end())
|
||||
continue;
|
||||
|
||||
if (testMode || trigger->needCheck())
|
||||
{
|
||||
if (minimal && node->getFirstRelevance() < 100)
|
||||
@@ -500,22 +503,21 @@ void Engine::ProcessTriggers(bool minimal)
|
||||
if (!event)
|
||||
continue;
|
||||
|
||||
// fires[trigger] = event;
|
||||
fires[trigger] = event;
|
||||
LogAction("T:%s", trigger->getName().c_str());
|
||||
MultiplyAndPush(node->getHandlers(), 0.0f, false, event, "trigger");
|
||||
}
|
||||
}
|
||||
|
||||
// for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||
// {
|
||||
// TriggerNode* node = *i;
|
||||
// Trigger* trigger = node->getTrigger();
|
||||
// if (fires.find(trigger) == fires.end())
|
||||
// continue;
|
||||
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||
{
|
||||
TriggerNode* node = *i;
|
||||
Trigger* trigger = node->getTrigger();
|
||||
if (fires.find(trigger) == fires.end())
|
||||
continue;
|
||||
|
||||
// Event event = fires[trigger];
|
||||
|
||||
// }
|
||||
Event event = fires[trigger];
|
||||
MultiplyAndPush(node->getHandlers(), 0.0f, false, event, "trigger");
|
||||
}
|
||||
|
||||
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user