Fixed combat information not being preserved in LKI and added unit test

This commit is contained in:
Daniel Bomar 2021-10-21 20:24:51 -05:00
parent 5e67314c96
commit 27d4fb13c3
No known key found for this signature in database
GPG key ID: C86C8658F4023918
4 changed files with 49 additions and 4 deletions

View file

@ -382,8 +382,8 @@ public final class ZonesHandler {
} else if (event.getTarget() != null) {
card.setFaceDown(info.faceDown, game);
Permanent target = event.getTarget();
success = game.getPlayer(target.getControllerId()).removeFromBattlefield(target, source, game)
&& target.removeFromZone(game, fromZone, source);
success = target.removeFromZone(game, fromZone, source)
&& game.getPlayer(target.getControllerId()).removeFromBattlefield(target, source, game);
} else {
card.setFaceDown(info.faceDown, game);
success = card.removeFromZone(game, fromZone, source);

View file

@ -1723,7 +1723,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
Zone fromZone = game.getState().getZone(objectId);
Player controller = game.getPlayer(controllerId);
if (controller != null) {
ZoneChangeEvent event = new ZoneChangeEvent(this.copy(), source, controllerId, fromZone, toZone, appliedEffects);
ZoneChangeEvent event = new ZoneChangeEvent(this, source, controllerId, fromZone, toZone, appliedEffects);
ZoneChangeInfo zoneChangeInfo;
if (toZone == Zone.LIBRARY) {
zoneChangeInfo = new ZoneChangeInfo.Library(event, flag /* put on top */);