* Desertion - fixed rollback error on fizzled counter spell (#7613);

This commit is contained in:
Oleg Agafonov 2021-02-22 08:51:07 +04:00
parent eb4f6d99dd
commit a377999f57
4 changed files with 49 additions and 11 deletions

View file

@ -65,7 +65,7 @@ public class GameEvent implements Serializable {
//player events
/* ZONE_CHANGE
targetId id of the zone changing object
sourceId sourceId of the ability with the object moving effect
sourceId sourceId of the ability with the object moving effect (WARNING, can be null if it move of fizzled spells)
playerId controller of the moved object
amount not used for this event
flag not used for this event

View file

@ -403,8 +403,8 @@ public class Spell extends StackObjImpl implements Card {
@Override
public void counter(Ability source, Game game, Zone zone, boolean owner, ZoneDetail zoneDetail) {
// source can be null for fizzled spells, found only one place with that usage -- Rebound Ability:
// event.getSourceId().equals(source.getSourceId())
// source can be null for fizzled spells, don't use that code in your ZONE_CHANGE watchers/triggers:
// event.getSourceId().equals
// TODO: so later it must be replaced to another technics with non null source
UUID counteringSourceId = (source == null ? null : source.getSourceId());
this.countered = true;