mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Fixed equal or == errors -- 23 cards and more (see #4407)
This commit is contained in:
parent
15fa8fa124
commit
c24ba742f6
36 changed files with 115 additions and 75 deletions
|
|
@ -757,8 +757,8 @@ public class GameState implements Serializable, Copyable<GameState> {
|
|||
ZoneChangeData data = (ZoneChangeData) obj;
|
||||
return this.fromZone == data.fromZone
|
||||
&& this.toZone == data.toZone
|
||||
&& this.sourceId == data.sourceId
|
||||
&& this.playerId == data.playerId;
|
||||
&& Objects.equals(this.sourceId, data.sourceId)
|
||||
&& Objects.equals(this.playerId, data.playerId);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,11 +28,8 @@
|
|||
package mage.game.combat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import mage.abilities.common.ControllerAssignCombatDamageToBlockersAbility;
|
||||
import mage.abilities.common.ControllerDivideCombatDamageAbility;
|
||||
import mage.abilities.common.DamageAsThoughNotBlockedAbility;
|
||||
|
|
@ -286,7 +283,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
if (attacker == null) {
|
||||
return;
|
||||
}
|
||||
boolean oldRuleDamage = (player.getId() == defendingPlayerId);
|
||||
boolean oldRuleDamage = (Objects.equals(player.getId(), defendingPlayerId));
|
||||
int damage = getDamageValueFromPermanent(attacker, game);
|
||||
if (canDamage(attacker, first)) {
|
||||
// must be set before attacker damage marking because of effects like Test of Faith
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ package mage.game.command.planes;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.ActivateIfConditionActivatedAbility;
|
||||
|
|
@ -132,7 +133,7 @@ class EdgeOfMalacolEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
}
|
||||
}
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && filter.match(permanent, game) && permanent.getControllerId() == game.getActivePlayerId()) {
|
||||
if (permanent != null && filter.match(permanent, game) && Objects.equals(permanent.getControllerId(), game.getActivePlayerId())) {
|
||||
UUID oldController = source.getControllerId();
|
||||
source.setControllerId(game.getActivePlayerId());
|
||||
Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(2));
|
||||
|
|
|
|||
|
|
@ -3866,7 +3866,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
PlayerImpl obj = (PlayerImpl) o;
|
||||
Player obj = (Player) o;
|
||||
if (this.getId() == null || obj.getId() == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,11 +27,8 @@
|
|||
*/
|
||||
package mage.watchers.common;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
|
|
@ -67,7 +64,7 @@ public class BlockedByOnlyOneCreatureThisCombatWatcher extends Watcher {
|
|||
if (!blockedByOneCreature.containsKey(combatGroup)) {
|
||||
blockedByOneCreature.put(combatGroup, event.getSourceId());
|
||||
}
|
||||
else if (blockedByOneCreature.get(combatGroup) != event.getSourceId()) {
|
||||
else if (!Objects.equals(blockedByOneCreature.get(combatGroup), event.getSourceId())) {
|
||||
blockedByOneCreature.put(combatGroup, null);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue