Skip to content

Commit

Permalink
images: fixed wrong miss image message in card hints for dungeons and…
Browse files Browse the repository at this point in the history
… other command objects (part of #12274);
  • Loading branch information
JayDi85 committed Sep 20, 2024
1 parent ff02322 commit e1ab0be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Mage.Common/src/main/java/mage/view/StackAbilityView.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class StackAbilityView extends CardView {

public StackAbilityView(Game game, StackAbility ability, String sourceName, MageObject sourceObject, CardView sourceView) {
this.id = ability.getId();
this.mageObjectType = MageObjectType.ABILITY_STACK;
this.mageObjectType = sourceView.getMageObjectType().isUseTokensRepository() ? MageObjectType.ABILITY_STACK_FROM_TOKEN : MageObjectType.ABILITY_STACK_FROM_CARD;
this.abilityType = ability.getStackAbility().getAbilityType();
this.sourceCard = sourceView;
this.sourceCard.setMageObjectType(mageObjectType);
Expand Down
7 changes: 0 additions & 7 deletions Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1126,17 +1126,10 @@ private void tryToPlayPriority(Game game) {

private Permanent findPermanentWithAssert(PlayerAction action, Game game, Player player, String cardName) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(player.getId())) {
// need by controller
if (!perm.getControllerId().equals(player.getId())) {
continue;
}

// need by alias or by name
if (!hasObjectTargetNameOrAlias(perm, cardName)) {
continue;
}

// all fine
return perm;
}
printStart(game, "Permanents of " + player.getName());
Expand Down
3 changes: 2 additions & 1 deletion Mage/src/main/java/mage/constants/MageObjectType.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
* @author LevelX2
*/
public enum MageObjectType {
ABILITY_STACK("Ability on the Stack", false, false, false),
ABILITY_STACK_FROM_CARD("Ability on the Stack", false, false, false),
ABILITY_STACK_FROM_TOKEN("Ability on the Stack", false, false, true),
CARD("Card", false, true, false),
COPY_CARD("Copy of a Card", false, true, false),
TOKEN("Token", true, true, true),
Expand Down

0 comments on commit e1ab0be

Please sign in to comment.