fix!(lua.utils): remove dead EDITION branch from card set extractor

Đang mở
#218 0 bình luận 0 reaction 1 người được giao Xem trên GitHub

@S1M0N38 đang làm issue này rồi.

Từ ngày 9/7/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

completed-in-dev

Problem

extract_card() in src/lua/utils/gamestate.lua (lines 316-317) has an unreachable branch:

elseif ability_set == "Edition" then
  set = "EDITION"

The matching value is advertised in the Card.Set alias: ---| "EDITION" # Card with an edition (src/lua/utils/enums.lua:81).

Why it's dead

Editions (foil/holo/polychrome/negative) are modeled as card.edition and surfaced in modifier.edition — orthogonal to a card's type. ability.set is only ever Joker/Tarot/Planet/Spectral/Voucher/Booster/Default/Enhanced, never Edition, so the branch never fires.

Empirically verified — added edition cards of every type × every edition and scanned the full gamestate: 0 cards report set == "EDITION".

Card set modifier.edition
j_joker + polychrome JOKER e_polychrome
c_magician + negative TAROT e_negative
H_A + foil DEFAULT e_foil

The enums.lua comment # Card with an edition is also wrong — editions are modifiers, not a set.

Proposed fix

  • Remove the elseif ability_set == "Edition" branch from extract_card() (gamestate.lua).
  • Remove the ---| "EDITION" line from the Card.Set alias (enums.lua).
  • Regenerate openrpc.json.

Behavior-neutral (the branch never executes); no test coverage is affected.

Ngôn ngữ chính
Python
Star
80
Fork
23
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/balatrobot

Tất cả issue của coder/balatrobot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.