mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Fixed cancelAction method
This commit is contained in:
1 parent
4d9e15c7af
commit
6762af5505
1 file changed
+13
-2
@@ -122,9 +122,20 @@ public class ScriptedActionManager implements IActionManager {
|
||||
|
||||
@Override
|
||||
public boolean cancelAction(String name) {
|
||||
for (IAction act : actionQueue) {
|
||||
Iterator<IAction> acts = actionQueue.iterator();
|
||||
while (acts.hasNext()) {
|
||||
IAction act = acts.next();
|
||||
if (act.getName().equals(name)) {
|
||||
((LinkedList<IAction>) actionQueue).remove(act);
|
||||
acts.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Iterator<IConditionalAction> cons = conditionalActions.iterator();
|
||||
while (cons.hasNext()) {
|
||||
IConditionalAction con = cons.next();
|
||||
if (con.getName().equals(name)) {
|
||||
cons.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user