* Fixed a bug that allowed to apply damage prevention replacement effects under certain circumstances multiple times to the same event.

This commit is contained in:
LevelX2 2014-07-31 15:16:48 +02:00
parent 84246e1935
commit 1a1fc09221
2 changed files with 6 additions and 1 deletions

View file

@ -87,7 +87,7 @@ public class HumanPlayer extends PlayerImpl {
private static final Logger log = Logger.getLogger(HumanPlayer.class);
static {
replacementEffectChoice.setMessage("Choose replacement effect");
replacementEffectChoice.setMessage("Choose replacement effect to resolve first");
staticOptions.put("UI.right.btn.text", "Done");
}

View file

@ -359,6 +359,11 @@ public class ContinuousEffects implements Serializable {
}
}
for (PreventionEffect effect: preventionEffects) {
if (event.getAppliedEffects() != null && event.getAppliedEffects().contains(effect.getId())) {
// Effect already applied to this event, ignore it
// TODO: Handle also gained effect that are connected to different abilities.
continue;
}
HashSet<Ability> abilities = preventionEffects.getAbility(effect.getId());
HashSet<Ability> applicableAbilities = new HashSet<>();
for (Ability ability : abilities) {