Skip to content

Fix for cards with negative card_limit drawing ghost cards#1418

Open
Oinite12 wants to merge 1 commit into
Steamodded:mainfrom
Oinite12:main
Open

Fix for cards with negative card_limit drawing ghost cards#1418
Oinite12 wants to merge 1 commit into
Steamodded:mainfrom
Oinite12:main

Conversation

@Oinite12
Copy link
Copy Markdown

@Oinite12 Oinite12 commented Jun 4, 2026

Given the following enhancement:

SMODS.Enhancement {
	key = "test",
	config = {
		card_limit = -1
	}
}

When two cards - a card with the above enhancement, and a card without that above enhancement - are drawn, a third "ghost card" may also be drawn.

Screencast_20260603_215826.mp4

This PR fixes that issue by simply accounting for cards_to_draw[i].ability.card_limit when calculating SMODS.cards_to_draw.

Screencast_20260603_215938.mp4

Additional Info:

  • I didn't modify api's or I've made a PR to the wiki repo.
  • I didn't modify api's or I've updated lsp definitions.
  • I didn't make new lovely files or all new lovely files have appropriate priority.

Copy link
Copy Markdown
Member

@Eremel Eremel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, hadn’t considered people using card limit in a negative way over using extra slots. Does this still function correctly with a card d with a positive card_limit?

@Oinite12
Copy link
Copy Markdown
Author

Oinite12 commented Jun 4, 2026

Given the following enhancement:

SMODS.Enhancement {
	key = "test",
	config = {
		card_limit = 1
	}
}

Well-behaved functionality occurs when drawing cards with this enhancement.

Screencast_20260604_115807.0.11.2.-.0.30.4.mp4

In a deck with two enhancements - one with positive card_limit (Red), the other with negative card_limit (Blue) - well-behaved functionality also occurs.

Screencast_20260604_120110.0.08.8.-.0.32.5.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants