Fixed a bug that the event LIFE_GAINED event did not include the correct amount of life, if replacement effects had changed that amount.

This commit is contained in:
LevelX2 2013-05-24 14:49:47 +02:00
parent 25b283483f
commit 4f8fe8c510

View file

@ -1049,8 +1049,8 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
GameEvent event = new GameEvent(GameEvent.EventType.GAIN_LIFE, playerId, playerId, playerId, amount, false);
if (!game.replaceEvent(event)) {
this.life += event.getAmount();
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE, playerId, playerId, playerId, amount));
return amount;
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.GAINED_LIFE, playerId, playerId, playerId, event.getAmount()));
return event.getAmount();
}
return 0;
}