mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
CardUtil: getLKICopy should not update the View
This commit is contained in:
@@ -608,7 +608,13 @@ public class CardFactory {
|
||||
* @param toState
|
||||
* the {@link CardStateName} of {@code to} to copy to.
|
||||
*/
|
||||
public static void copyState(final Card from, final CardStateName fromState, final Card to, final CardStateName toState) {
|
||||
public static void copyState(final Card from, final CardStateName fromState, final Card to,
|
||||
final CardStateName toState) {
|
||||
copyState(from, fromState, to, toState, true);
|
||||
}
|
||||
|
||||
public static void copyState(final Card from, final CardStateName fromState, final Card to,
|
||||
final CardStateName toState, boolean updateView) {
|
||||
// copy characteristics not associated with a state
|
||||
to.setBaseLoyalty(from.getBaseLoyalty());
|
||||
to.setBasePowerString(from.getBasePowerString());
|
||||
@@ -617,10 +623,9 @@ public class CardFactory {
|
||||
|
||||
// get CardCharacteristics for desired state
|
||||
if (!to.getStates().contains(toState)) {
|
||||
to.addAlternateState(toState, true);
|
||||
to.addAlternateState(toState, updateView);
|
||||
}
|
||||
final CardState toCharacteristics = to.getState(toState),
|
||||
fromCharacteristics = from.getState(fromState);
|
||||
final CardState toCharacteristics = to.getState(toState), fromCharacteristics = from.getState(fromState);
|
||||
toCharacteristics.copyFrom(from, fromCharacteristics);
|
||||
}
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ public final class CardUtil {
|
||||
// don't just copy the current state. copy all of them
|
||||
// needed for Transformed to get the CMC correct
|
||||
for (final CardStateName state : in.getStates()) {
|
||||
CardFactory.copyState(in, state, newCopy, state);
|
||||
CardFactory.copyState(in, state, newCopy, state, false);
|
||||
}
|
||||
// DO NOT UPDATE THE VIEW!
|
||||
newCopy.setState(in.getCurrentStateName(), false);
|
||||
|
||||
Reference in New Issue
Block a user