Skip to content

Use StopTrigger ExecutionIntent in EffExit when applicable #7889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/ch/njol/skript/effects/EffExit.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelaye
debug(event, false);
for (SectionExitHandler section : sectionsToExit)
section.exit(event);
if (outerSection == null)
if (outerSection == null) // "stop trigger"
return null;
return outerSection instanceof LoopSection loopSection ? loopSection.getActualNext() : outerSection.getNext();
}
Expand All @@ -113,11 +113,15 @@ protected void execute(Event event) {

@Override
public @Nullable ExecutionIntent executionIntent() {
if (outerSection == null)
return ExecutionIntent.stopTrigger();
return ExecutionIntent.stopSections(breakLevels);
}

@Override
public String toString(@Nullable Event event, boolean debug) {
if (outerSection == null)
return "stop trigger";
return "stop " + breakLevels + " " + names[type];
}

Expand Down