Restore check to treat empty room as dynamic state (#9009)

This commit is contained in:
tool4ever
2025-10-27 18:03:15 +01:00
committed by GitHub
parent 2ee356461c
commit 5fc1d4214b

View File

@@ -557,20 +557,18 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars, ITr
boolean needsTransformAnimation = transform || rollback; boolean needsTransformAnimation = transform || rollback;
// faceDown has higher priority over clone states // faceDown has higher priority over clone states
// while text change states doesn't apply while the card is faceDown // while text change states doesn't apply while the card is faceDown
if (state != CardStateName.FaceDown) { if (state != CardStateName.FaceDown && state != CardStateName.EmptyRoom) {
CardCloneStates cloneStates = getLastClonedState(); CardCloneStates cloneStates = getLastClonedState();
if (cloneStates != null) { if (cloneStates != null) {
if (!cloneStates.containsKey(state)) { if (!cloneStates.containsKey(state)) {
throw new RuntimeException(getName() + " tried to switch to non-existant cloned state \"" + state + "\"!"); throw new RuntimeException(getName() + " tried to switch to non-existant cloned state \"" + state + "\"!");
//return false; // Nonexistant state. //return false; // Nonexistant state.
} }
} else { } else if (!states.containsKey(state)) {
if (!states.containsKey(state)) {
System.out.println(getName() + " tried to switch to non-existant state \"" + state + "\"!"); System.out.println(getName() + " tried to switch to non-existant state \"" + state + "\"!");
return false; // Nonexistant state. return false; // Nonexistant state.
} }
} }
}
if (state.equals(currentStateName) && !forceUpdate) { if (state.equals(currentStateName) && !forceUpdate) {
return false; return false;