mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
fixed a test failure
This commit is contained in:
parent
27b85bca88
commit
5f23ccf24c
3 changed files with 7 additions and 3 deletions
|
@ -84,7 +84,7 @@ class FaithsRewardWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
|
||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ class FellShepherdWatcher extends Watcher {
|
|||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game));
|
||||
morMap.add(new MageObjectReference(((ZoneChangeEvent) event).getTarget(), game, 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,13 +26,17 @@ public class MageObjectReference implements Comparable<MageObjectReference>, Ser
|
|||
private final int zoneChangeCounter;
|
||||
|
||||
public MageObjectReference(MageObject mageObject, Game game) {
|
||||
this(mageObject, game, 0);
|
||||
}
|
||||
|
||||
public MageObjectReference(MageObject mageObject, Game game, int offset) {
|
||||
if (mageObject == null) {
|
||||
this.sourceId = null;
|
||||
this.zoneChangeCounter = -1;
|
||||
return;
|
||||
}
|
||||
this.sourceId = mageObject.getId();
|
||||
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game);
|
||||
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game) + offset;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue