- Somewhat better handling of player type check in the new routines.

This commit is contained in:
Agetian
2015-10-03 12:47:25 +00:00
parent 0dfab38a01
commit 4819316fbb

View File

@@ -1946,7 +1946,11 @@ public class ComputerUtil {
// This is currently used by ComputerUtilCost.willPayUnlessCost to determine if there's a viable target for a spell
// that can be paid for with an untapped shockland.
if (ai == null || aura == null || !(ai.getController() instanceof PlayerControllerAi)) {
if (ai == null || aura == null) {
return false;
}
if (!(ai.getController() instanceof PlayerControllerAi)) {
System.err.println("Unexpected behavior: ComputerUtil::hasGoodTargetforAura called with the non-AI player as a parameter.");
return false;
}
@@ -1987,7 +1991,11 @@ public class ComputerUtil {
// This is currently used by ComputerUtilCost.willPayUnlessCost to determine if there's a viable reason to cast a spell
// that can be paid for with an untapped shockland.
if (ai == null || sa == null || !(ai.getController() instanceof PlayerControllerAi)) {
if (ai == null || sa == null) {
return false;
}
if (!(ai.getController() instanceof PlayerControllerAi)) {
System.err.println("Unexpected behavior: ComputerUtil::hasReasonToPlaySaThisTurn called with the non-AI player as a parameter.");
return false;
}