Skip to content

Commit

Permalink
Merge pull request #140 from webadict/commit_stream
Browse files Browse the repository at this point in the history
Fixed Trigger Firing Issue
  • Loading branch information
demilich1 committed May 9, 2016
2 parents f9b183a + 93f7f64 commit 01e15fc
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.demilich.metastone.game.GameContext;
import net.demilich.metastone.game.entities.Entity;
import net.demilich.metastone.game.events.GameEvent;
import net.demilich.metastone.game.events.GameEventType;
import net.demilich.metastone.game.targeting.EntityReference;
Expand Down Expand Up @@ -75,7 +73,7 @@ public void fireGameEvent(GameEvent event) {
}

for (IGameEventListener trigger : eventTriggers) {
if (trigger.canFireCondition(event) && hostNotOnSideBoard(event, trigger.getHostReference())) {
if (trigger.canFireCondition(event) && triggers.contains(trigger)) {
trigger.onGameEvent(event);
}

Expand Down Expand Up @@ -128,13 +126,4 @@ public void removeTriggersAssociatedWith(EntityReference entityReference) {
}
}

public boolean hostNotOnSideBoard(GameEvent event, EntityReference entityReference) {
GameContext context = event.getGameContext();
Entity entity = context.resolveSingleTarget(entityReference);
if (context.getPlayer1().getSetAsideZone().contains(entity) || context.getPlayer2().getSetAsideZone().contains(entity)) {
return false;
}
return true;
}

}

0 comments on commit 01e15fc

Please sign in to comment.