mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
* Prevention effects - Fixed that prevention effects also prevented damage that was not preventable (fixes #983).
This commit is contained in:
parent
f5245ade01
commit
6097e297fe
3 changed files with 77 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue