Skip to content

Shelved PR 169 gear price double count

rayswaynl edited this page Jul 2, 2026 · 1 revision

Shelved: PR #169 — gear price container "double count"

Shelved by Ray's Build 87 pick (decision 15C), 2026-07-02. Not merged.

WHAT it is

PR #169 ("Fix gear price container double count", lane 34 / AUDIT-60) removes a trailing forEach _gear_new suffix from the backpack/vehicle gear-price preview loop in Client_UI_Gear_UpdatePrice.sqf. The audit claimed the surviving for '_k' from 0 to count(_gear_new)-1 do { ... } forEach _gear_new; construct walks the container slots twice and inflates the displayed gear price.

Why it was shelved (the "double count" is most likely a parse no-op): In SQF a for ... do { ... } block evaluates to the value of its last statement — here _prefix = if (_k == 0) then {"Mag_"} else {""};, i.e. a String. The suspect line therefore reduces to <String> forEach <array>, which is a type error, not a second pricing pass: forEach expects Code on its left, so the trailing forEach _gear_new does not re-run the addition loop — it raises a script error / no-ops. The net effect on the displayed price (and on the wallet, since the purchase/debit path is untouched) is ~zero. So the reported bug is cosmetic-at-worst and quite possibly invisible; Ray chose not to spend a Build 87 slot on it.

WHERE

  • PR: #169
  • Branch: codex/gear-price-double-count (head commit 0fdfc1c53)
  • Base: claude/build84-cmdcon36 (live lane)
  • Files (2, +4/-4, mirror pair):
    • Missions/[55-2hc]warfarev2_073v48co.chernarus/Client/Functions/Client_UI_Gear_UpdatePrice.sqf
    • Missions_Vanilla/[61-2hc]warfarev2_073v48co.takistan/Client/Functions/Client_UI_Gear_UpdatePrice.sqf
    • The edited line is around line ~89 (} forEach _gear_new;};) inside the if !(WF_A2_Vanilla) backpack/vehicle add-price block, plus a trailing newline normalization on the final [_price].

STATE

  • Technically a clean diff (bracket-delta (0,0,0) on both files, A3-trap / Boolean scans clean, CH/TK SHA-matched, LoadoutManager mirror verified).
  • Unmerged. Left open at shelve time, then closed with a link to this page.
  • No flag: it was authored as a pure bugfix, so reviving it does not need a gate.

HOW TO REVIVE

  1. Re-open PR #169 (or cherry-pick 0fdfc1c53) and rebase onto the current live laneClient_UI_Gear_UpdatePrice.sqf may have drifted; re-mirror CH→TK via Tools/LoadoutManager (dotnet run -c Release) after any edit.
  2. Optional smoke test of the price display before merging: in a CO / non-vanilla client gear dialog, add backpack or vehicle gear across multiple container slots and confirm the previewed price increments once per selected item/count (not once per container × the whole addition pass), and that flat weapon/magazine additions still price normally. If the display is already correct without the fix, that confirms the parse-no-op reading and the PR can stay shelved.
  3. Revert path if ever merged and regretted: restore the removed forEach _gear_new suffix on both mirrored files.

Sidebar

Clone this wiki locally