Fixed a bug that the owner of controlled cards were no longer shown in the card tooltip.
@@ -347,17 +347,19 @@ public class CardView extends SimpleCardView {
if (card instanceof Permanent) {
this.mageObjectType = MageObjectType.PERMANENT;
Permanent permanent = (Permanent) card;
- if (game != null && permanent.getCounters(game) != null && !permanent.getCounters(game).isEmpty()) {
+ if (game != null) {
+ if (permanent.getCounters(game) != null && !permanent.getCounters(game).isEmpty()) {
this.loyalty = Integer.toString(permanent.getCounters(game).getCount(CounterType.LOYALTY));
this.pairedCard = permanent.getPairedCard() != null ? permanent.getPairedCard().getSourceId() : null;
- if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
- controlledByOwner = false;
- }
counters = new ArrayList<>();
for (Counter counter : permanent.getCounters(game).values()) {
counters.add(new CounterView(counter));
}
}
+ if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
+ controlledByOwner = false;
+ }
+ }
} else {
if (card.isCopy()) {
this.mageObjectType = MageObjectType.COPY_CARD;
