Skip to content

Commit

Permalink
Merge pull request #92 from SkriptLang/fix-event-parsing
Browse files Browse the repository at this point in the history
Ensure lastWhich is set correctly for CustomEvent parsing
  • Loading branch information
sovdeeth authored Feb 1, 2024
2 parents d49527b + 28f4893 commit c0a5cb3
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ public boolean init(Literal<?>[] args, int matchedPattern, SkriptParser.ParseRes
return event.isMarkedContinue();
}

@Override
public boolean load() {
CustomEvent.setLastWhich(which);
boolean parsed = super.load();
CustomEvent.setLastWhich(null);
return parsed;
}

@Override
public boolean check(Event e) {
BukkitCustomEvent bukkitCustomEvent = (BukkitCustomEvent) e;
Expand Down

0 comments on commit c0a5cb3

Please sign in to comment.