mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 17:09:08 +00:00
Fix stuck on knockback, enhance movement & flee and trap weave strats (#980)
* Hunter trap weave strats * Do not allow actions to stack * Remove trap weave by default * Refactor on Engine Co-authored-by: SaW <swerkhoven@outlook.com> * Remove unused funcs in Queue * Remove ExpireActionTime config --------- Co-authored-by: SaW <swerkhoven@outlook.com>
This commit is contained in:
@@ -87,27 +87,23 @@ Engine::~Engine(void)
|
||||
void Engine::Reset()
|
||||
{
|
||||
strategyTypeMask = 0;
|
||||
|
||||
ActionNode* action = nullptr;
|
||||
do
|
||||
{
|
||||
action = queue.Pop();
|
||||
if (!action)
|
||||
break;
|
||||
|
||||
while ((action = queue.Pop()) != nullptr)
|
||||
{
|
||||
delete action;
|
||||
} while (true);
|
||||
}
|
||||
|
||||
for (std::vector<TriggerNode*>::iterator i = triggers.begin(); i != triggers.end(); i++)
|
||||
for (TriggerNode* trigger : triggers)
|
||||
{
|
||||
TriggerNode* trigger = *i;
|
||||
delete trigger;
|
||||
}
|
||||
|
||||
triggers.clear();
|
||||
|
||||
for (std::vector<Multiplier*>::iterator i = multipliers.begin(); i != multipliers.end(); i++)
|
||||
for (Multiplier* multiplier : multipliers)
|
||||
{
|
||||
Multiplier* multiplier = *i;
|
||||
delete multiplier;
|
||||
}
|
||||
|
||||
@@ -244,8 +240,13 @@ bool Engine::DoNextAction(Unit* unit, uint32 depth, bool minimal)
|
||||
|
||||
if (!actionExecuted)
|
||||
LogAction("No actions executed");
|
||||
|
||||
ActionNode* action = nullptr;
|
||||
while ((action = queue.Pop()) != nullptr)
|
||||
{
|
||||
delete action;
|
||||
}
|
||||
|
||||
queue.RemoveExpired(); // Clean up expired actions in the queue
|
||||
return actionExecuted;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user