From: David ‘Bombe’ Roden Date: Thu, 3 Jan 2013 08:28:50 +0000 (+0100) Subject: Skip filters if any state is not successful. X-Git-Tag: 0.1~92 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=346b1359e97918e3ee8ef29240c7709abd9edd85;p=rhynodge.git Skip filters if any state is not successful. --- diff --git a/src/main/java/net/pterodactylus/reactor/engine/Engine.java b/src/main/java/net/pterodactylus/reactor/engine/Engine.java index 949ce12..6454419 100644 --- a/src/main/java/net/pterodactylus/reactor/engine/Engine.java +++ b/src/main/java/net/pterodactylus/reactor/engine/Engine.java @@ -137,11 +137,15 @@ public class Engine extends AbstractExecutionThreadService { /* convert states. */ for (Filter filter : nextReaction.filters()) { - net.pterodactylus.reactor.State newState = filter.filter(state); - logger.debug(String.format("Old state is %s, new state is %s.", state, newState)); - state = newState; + if (state.success()) { + net.pterodactylus.reactor.State newState = filter.filter(state); + logger.debug(String.format("Old state is %s, new state is %s.", state, newState)); + state = newState; + } + } + if (state.success()) { + reactionExecution.addState(state); } - reactionExecution.addState(state); /* only run trigger if we have collected two states. */ Trigger trigger = nextReaction.trigger();