Scheduled conditionals properly using after(), before() and sequential schedule()

This commit is contained in:
bigguy345 committed 2025-06-30 20:14:08 +03:00
1 parent e69bbd13b0
commit 8b4892cb35
2 files changed
+9

No files matched your search

@@ -365,6 +365,9 @@ public class Action implements IAction {
}
@Override
public IAction after(IAction after) {
if (after instanceof IConditionalAction)
return conditional((IConditionalAction) after);
int idx = manager.getIndex(this);
if (idx >= 0)
manager.scheduleActionAt(idx + 1, after);
@@ -403,6 +406,9 @@ public class Action implements IAction {
@Override
public IAction before(IAction before) {
if (before instanceof IConditionalAction)
return conditional((IConditionalAction) before);
int idx = manager.getIndex(this);
if (idx >= 0)
manager.scheduleActionAt(Math.max(0, idx), before);
@@ -101,6 +101,9 @@ public class ActionManager implements IActionManager {
@Override
public IAction schedule(IAction action) {
if (action instanceof IConditionalAction)
return schedule((IConditionalAction) action);
Action act = (Action) action;
if (act.unscheduledBefore != null)
act.scheduleAllBefore(actionQueue);