mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch 'guiChoiceFixGameCache' into 'master'
Player Human: fix chooseSingleEntityForEffect See merge request core-developers/forge!2839
This commit is contained in:
@@ -545,6 +545,16 @@ public class Game {
|
||||
}
|
||||
}
|
||||
|
||||
public Card findByView(CardView view) {
|
||||
CardIdVisitor visit = new CardIdVisitor(view.getId());
|
||||
if (ZoneType.Stack.equals(view.getZone())) {
|
||||
visit.visitAll(getStackZone());
|
||||
} else {
|
||||
visit.visitAll(getPlayer(view.getController()).getZone(view.getZone()));
|
||||
}
|
||||
return visit.getFound();
|
||||
}
|
||||
|
||||
public Card findById(int id) {
|
||||
CardIdVisitor visit = new CardIdVisitor(id);
|
||||
this.forEachCardInGame(visit);
|
||||
|
||||
@@ -465,7 +465,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
gameCacheChoose.getTrackableKeys(), delayedReveal, isOptional);
|
||||
endTempShowCards();
|
||||
|
||||
if (result != null || !gameCacheChoose.containsKey(result)) {
|
||||
if (result == null || !gameCacheChoose.containsKey(result)) {
|
||||
return null;
|
||||
}
|
||||
return gameCacheChoose.get(result);
|
||||
@@ -3014,7 +3014,7 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
|
||||
}
|
||||
|
||||
public Card getCard(final CardView cardView) {
|
||||
return getGame().findById(cardView.getId());
|
||||
return getGame().findByView(cardView);
|
||||
}
|
||||
|
||||
public CardCollection getCardList(Iterable<CardView> cardViews) {
|
||||
|
||||
Reference in New Issue
Block a user