Skip to content

Commit

Permalink
(INTERNAL BREAKING) run a *copy* of the event, not the original
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 29, 2020
1 parent 4a0fd5a commit 3a6ae8e
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,12 @@ public boolean matches(ScriptPath path) {
public abstract String getName();

public void fire() {
ScriptEvent copy = clone();
stats.fires++;
for (ScriptPath path : eventPaths) {
try {
if (matchesScript(this, path)) {
run(path);
copy.run(path);
}
}
catch (Exception e) {
Expand All @@ -385,7 +386,7 @@ public void run(ScriptPath path) {
List<ScriptEntry> entries = ScriptContainer.cleanDup(getScriptEntryData(), path.set);
ScriptQueue queue = new InstantQueue(path.container.getName()).addEntries(entries);
currentEvent = path.event;
queue.setContextSource(this.clone());
queue.setContextSource(this);
queue.determinationTarget = (o) -> applyDetermination(path, o);
queue.start();
stats.nanoTimes += System.nanoTime() - queue.startTime;
Expand Down

0 comments on commit 3a6ae8e

Please sign in to comment.