Skip to content

Fix disabled hidden consumables remaining in legendary pool - #950

Open
ieuze wants to merge 1 commit into
SpectralPack:mainfrom
ieuze:fix/disabled-legendary-consumables
Open

ieuze wants to merge 1 commit into
SpectralPack:mainfrom
ieuze:fix/disabled-legendary-consumables

Conversation

@ieuze

@ieuze ieuze commented Sep 26, 2026

Copy link
Copy Markdown

Disabling Cryptid's Spectral set removes White Hole from G.P_CENTERS, but leaves it in SMODS.Consumable.legendaries. A Celestial Pack can still roll c_cry_white_hole, causing create_card to index a nil center.

Remove hidden consumables from the legendary pool when disabling them and restore them when re-enabling them, matching Steamodded's hidden-consumable injection/deletion behavior. The existing disabled-state guards prevent duplicate entries on repeated enable calls.

Validation:

  • Reproduced the stale White Hole pool entry with the original implementation in an isolated Lua 5.1 harness using the installed Steamodded pool helpers.
  • The patched implementation passes disable/re-enable, repeated toggles, repeated enable/disable calls, and preservation of ordinary consumables and other hidden consumables.
  • Lua 5.1 syntax validation and git diff --check pass.
  • Applied the same change to Cryptid 0.5.16c locally; in-game verification has not been performed.

Copilot AI lite review requested due to automatic review settings September 26, 2026 20:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Critical and moderate issues remain in the enable/disable pool handling.

Review effort: Lite
Findings: 1 High severity

Open (1)
What changed in this PR

Fixes gameset toggling so hidden consumables stay synchronized with the legendary pool.

Changes:

  • Removes hidden consumables when disabled.
  • Restores them when re-enabled.
File Summary
lib/​gameset.lua Synchronizes hidden consumables with the legendary pool; pool references still require correction.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/gameset.lua
SMODS.Center.enable(self)
SMODS.insert_pool(G.P_CENTER_POOLS["Consumeables"], self)
if self.hidden then
table.insert(self.legendaries, self)
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