Skip to content

Commit

Permalink
Avoid ticking while already done
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Dec 19, 2024
1 parent e9f885b commit 0d4b527
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ public void tick() {

var localTask = this.controllingTask.get();
if (localTask != null) {
localTask.tick();

if (localTask.isDone()) {
localTask.stop();
unregisterControllingTask(localTask);
} else {
localTask.tick();

if (localTask.isDone()) {
localTask.stop();
unregisterControllingTask(localTask);
}
}
}
}
Expand Down

0 comments on commit 0d4b527

Please sign in to comment.