mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
Fix bug that prevented being able to play a card that had been returned to your hand or put on top of your library
This commit is contained in:
@@ -33,7 +33,7 @@ public class DamageDealEffect extends SpellAbilityEffect {
|
||||
return "";
|
||||
|
||||
final List<Card> definedSources = AbilityUtils.getDefinedCards(sa.getHostCard(), sa.getParam("DamageSource"), sa);
|
||||
Card source = definedSources.isEmpty() ? new Card(0) : definedSources.get(0);
|
||||
Card source = definedSources.isEmpty() ? new Card(-1) : definedSources.get(0);
|
||||
|
||||
if (source != sa.getHostCard()) {
|
||||
sb.append(source.toString()).append(" deals");
|
||||
|
||||
@@ -261,7 +261,7 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
||||
* @param id the unique id of the new card.
|
||||
*/
|
||||
public Card(final int id0) {
|
||||
this(id0, null);
|
||||
this(id0, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,9 +273,12 @@ public class Card extends GameEntity implements Comparable<Card>, IIdentifiable
|
||||
* @see IPaperCard
|
||||
*/
|
||||
public Card(final int id0, final IPaperCard paperCard0) {
|
||||
this(id0, paperCard0, true);
|
||||
}
|
||||
public Card(final int id0, final IPaperCard paperCard0, final boolean allowCache) {
|
||||
super(id0);
|
||||
|
||||
if (id0 >= 0) {
|
||||
if (id0 >= 0 && allowCache) {
|
||||
cardCache.put(id0, this);
|
||||
}
|
||||
paperCard = paperCard0;
|
||||
|
||||
@@ -213,7 +213,7 @@ public final class CardUtil {
|
||||
* @return a copy of C with LastKnownInfo stuff retained.
|
||||
*/
|
||||
public static Card getLKICopy(final Card in) {
|
||||
final Card newCopy = new Card(in.getId(), in.getPaperCard());
|
||||
final Card newCopy = new Card(in.getId(), in.getPaperCard(), false);
|
||||
newCopy.setSetCode(in.getSetCode());
|
||||
newCopy.setOwner(in.getOwner());
|
||||
newCopy.setController(in.getController(), 0);
|
||||
|
||||
Reference in New Issue
Block a user