Skip to content

Fix state handling and inventory scan logic in weaponRefine plugin#1

Open
kw4k wants to merge 1 commit into
mainfrom
codex/analyze-weaponrefine.pl-plugin
Open

Fix state handling and inventory scan logic in weaponRefine plugin#1
kw4k wants to merge 1 commit into
mainfrom
codex/analyze-weaponrefine.pl-plugin

Conversation

@kw4k

@kw4k kw4k commented Mar 4, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Correct several correctness and stability issues in the Whitesmith weapon refine plugin that caused incorrect state checks, unintended regex matches, and premature inventory scan termination.

Description

  • Fix the weapon-name regex range typo from A-za-z to A-Za-z to prevent unintended character ranges.
  • Replace string equality operators (eq/ne) with numeric operators (==/!=) for comparisons against TRUE/FALSE and state constants to make control flow consistent.
  • Change findAndSetWeapon to reset weaponInInventory and weaponSetStatus before scanning and to scan the entire inventory instead of aborting on the first non-matching entry.
  • Make setRefineAmount accept the argument via my ($arg) and assign it to the global $refineAmount, and replace undef $weaponInInventory with explicit FALSE to keep state consistent.

Testing

  • Ran a syntax check with perl -c weaponRefine.pl, which could not complete because OpenKore runtime modules (e.g. Plugins.pm) are not available in the current environment and reported missing modules in @INC (so the check failed here).
  • No further automated runtime tests could be executed in this environment due to the lack of OpenKore-specific modules and runtime context.

Codex Task

@kw4k kw4k closed this Mar 4, 2026
@kw4k kw4k reopened this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant