* Prevention effects - Fixed that prevention effects also prevented damage that was not preventable (fixes #983).

This commit is contained in:
LevelX2 2015-05-21 00:25:37 +02:00
parent f5245ade01
commit 6097e297fe
3 changed files with 77 additions and 1 deletions

View file

@ -2112,6 +2112,9 @@ public abstract class GameImpl implements Game, Serializable {
@Override
public PreventionEffectData preventDamage(GameEvent event, Ability source, Game game, int amountToPrevent) {
PreventionEffectData result = new PreventionEffectData(amountToPrevent);
if (!event.getFlag()) { // damage is not preventable
return result;
}
if (!(event instanceof DamageEvent)) {
result.setError(true);
return result;