Skip to content

verify default_lflist after loading#3136

Merged
mercury233 merged 1 commit into
Fluorohydride:masterfrom
mercury233:patch-lflist-1
Jul 10, 2026
Merged

verify default_lflist after loading#3136
mercury233 merged 1 commit into
Fluorohydride:masterfrom
mercury233:patch-lflist-1

Conversation

@mercury233

Copy link
Copy Markdown
Collaborator

fix #3126

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Moves default_lflist validation to the point where the LF list has just been loaded, ensuring the config index is clamped before UI components and the deck builder consume it (follow-up/fix for PR #3126).

Changes:

  • Validate/clamp gameConf.default_lflist immediately after deckManager.LoadLFList() in Game::Initialize().
  • Remove redundant validation logic from DeckBuilder::Initialize() and directly index into _lfList using the (now prevalidated) config value.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
gframe/game.cpp Validates default_lflist after LF list load so downstream UI/deck builder indexing is safe.
gframe/deck_con.cpp Simplifies deck builder initialization by relying on the centralized validation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gframe/game.cpp
Comment on lines +104 to +105
if(gameConf.default_lflist >= (int)deckManager._lfList.size() || gameConf.default_lflist < 0)
gameConf.default_lflist = 0;

@salix5 salix5 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

我沒意見.jpg

@mercury233 mercury233 merged commit a23e1b6 into Fluorohydride:master Jul 10, 2026
16 checks passed
@mercury233 mercury233 deleted the patch-lflist-1 branch July 10, 2026 01:12
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.

3 participants