-
Notifications
You must be signed in to change notification settings - Fork 0
Vehicle Cargo Equip Loop Bounds
This page documents a confirmed cargo-application loop-bound bug in vehicle and backpack gear helpers. It replaces the older vague scout note in Gear/loadout/EASA atlas.
All mission paths are relative to Missions/[55-2hc]warfarev2_073v48co.chernarus/.
flowchart TD
BuyGear["Client/GUI/GUI_BuyGearMenu.sqf"] --> GetVehicle["Client_GetVehicleContent.sqf"]
GetVehicle --> VehicleContent["_gear_sel_vehicle / _gear_vehicle_content"]
BuyGear --> EquipVehicle["Common_EquipVehicle.sqf"]
BuildUnit["Client_BuildUnit.sqf soldier gear path"] --> EquipBackpack["Common_EquipBackpack.sqf"]
EquipUnit["Common_EquipUnit.sqf"] --> EquipBackpack
| Source | Evidence |
|---|---|
Common/Init/Init_Common.sqf:118,120 |
Compiles WFBE_CO_FNC_EquipBackpack and WFBE_CO_FNC_EquipVehicle when not running the A2 vanilla fallback. |
Client/GUI/GUI_BuyGearMenu.sqf:94,102,108 |
Reads current vehicle cargo through Client_GetVehicleContent.sqf and stores selected cargo arrays. |
Client/GUI/GUI_BuyGearMenu.sqf:439 |
Applies selected vehicle cargo with [vehicle _target, _gear_sel_vehicle] Call WFBE_CO_FNC_EquipVehicle. |
Client/Functions/Client_GetVehicleContent.sqf:20-22 |
Reads cargo with safe for '_i' from 0 to count(_items)-1 loops. The collector is not the bug. |
Common/Functions/Common_EquipVehicle.sqf:27,33,39 |
Applies weapon, magazine and backpack cargo. Docs/source HEAD@c96ee1670ddb is unchanged from ebfdca96542f / b2544207 for checked cargo helpers, and with current Miksuu b8389e748243 plus historical EASA QoL a66d4691 still uses inclusive count(_items) loops. Current stable/B74.1 origin/master@f8a76de34 / origin/claude/b74.1-aicom@f8a76de34, current B74.2 origin/claude/b74.2-aicom@21b62b04, current B69 origin/claude/b69@8d465fce, adjacent B74 origin/claude/b74-aicom-spend@b23f557f and historical release a96fdda2 use corrected (count(_items) - 1) loops in both maintained roots. |
Common/Functions/Common_EquipBackpack.sqf:35,41 |
Applies backpack weapon and magazine contents. The same branch split applies: old-shape docs/current-Miksuu/EASA/perf-Vanilla targets still overrun by one, while current stable/B74.1/current B74.2/B69/B74 and historical release are already fixed in both maintained roots. |
Client/Functions/Client_BuildUnit.sqf:229 |
Calls WFBE_CO_FNC_EquipBackpack for soldier purchases when a backpack is present. |
Common/Functions/Common_EquipUnit.sqf:38 |
Calls WFBE_CO_FNC_EquipBackpack for unit loadout application. |
| Root / branch | Common_EquipVehicle.sqf |
Common_EquipBackpack.sqf |
Practical meaning |
|---|---|---|---|
Docs/source docs/developer-wiki-index@c96ee1670ddb
|
Source-unchanged from ebfdca96542f / b2544207 for checked cargo helper paths; inclusive weapon, magazine and backpack loops remain at :27, :33, :39 in Chernarus and maintained Vanilla. |
Inclusive weapon and magazine loops remain at :35, :41 in Chernarus and maintained Vanilla. |
Patch-ready on the docs/source branch and any target derived from it. |
Current stable/B74.1 origin/master@f8a76de34 / origin/claude/b74.1-aicom@f8a76de34, current B74.2 origin/claude/b74.2-aicom@21b62b04, current B69 origin/claude/b69@8d465fce and adjacent B74 origin/claude/b74-aicom-spend@b23f557f
|
Fixed to (count(_items) - 1) in both maintained roots at :27, :33, :39. |
Fixed to (count(_items) - 1) in both maintained roots at :35, :41. |
Do not reopen this defect on current stable/B74-shaped refs; preserve the fix when merging older branches. Checked 0139a3468609..origin/master, d472da6a..origin/claude/b74.2-aicom, origin/master..origin/claude/b74.2-aicom and origin/claude/b69..origin/claude/b74-aicom-spend cargo deltas are empty. |
Current Miksuu upstream miksuu/master@b8389e748243
|
Inclusive loops at :27, :33, :39 in both maintained roots. |
Inclusive loops at :35, :41 in both maintained roots. |
Current Miksuu does not carry the loop-bound rescue. The previously documented d9506078 is only local origin/claude/* branch evidence unless a future direct Miksuu fetch says otherwise. |
origin/perf/quick-wins 0076040f
|
Chernarus fixes all three loops to count(_items)-1; maintained Vanilla still carries inclusive loops. |
Chernarus fixes both loops to count(_items)-1; maintained Vanilla still carries inclusive loops. |
Perf branch is Chernarus-only for this fix; Vanilla propagation remains open there. |
Historical release commit a96fdda2
|
Fixed to (count(_items) - 1) in both maintained roots at :27, :33, :39. |
Fixed to (count(_items) - 1) in both maintained roots at :35, :41. |
Historical fixed checkpoint only; current origin exposes no release/* head on 2026-06-24. |
Historical EASA QoL commit a66d4691
|
Same inclusive loops in both maintained roots. | Same inclusive loops in both maintained roots. | Historical old-shape checkpoint only; current origin exposes no feat/buymenu-easa-qol head on 2026-06-24. |
SQF arrays are zero-indexed. These equip helpers iterate one slot past the last valid item:
for '_i' from 0 to count(_items) do {_vehicle addWeaponCargoGlobal [_items select _i, _counts select _i]};For an array with N entries, valid indexes are 0 through N - 1. Index N is out of range.
Confirmed old-shape locations:
| Helper | Loops |
|---|---|
Common_EquipVehicle.sqf |
weapon cargo :27, magazine cargo :33, backpack cargo :39 on docs/source HEAD@c96ee1670ddb, current Miksuu b8389e748243, historical EASA QoL a66d4691 and perf Vanilla |
Common_EquipBackpack.sqf |
backpack weapon cargo :35, backpack magazine cargo :41 on docs/source HEAD@c96ee1670ddb, current Miksuu b8389e748243, historical EASA QoL a66d4691 and perf Vanilla |
Likely impact:
- Each non-empty cargo application can attempt one out-of-range
_items select _i/_counts select _iat the end of the loop. - Depending on Arma 2 OA runtime behavior and logging settings, this may create RPT noise, abort the loop tail or fail silently after applying valid entries.
- Empty arrays may also enter the loop at index
0unless the surrounding content guard exits first;Common_EquipVehicle.sqfchecks only the top-level vehicle-content array, not each sub-array. - This is a correctness and reliability bug in local gear/cargo application, not a public-server authority fix.
Recommended first patch for old-shape targets:
for '_i' from 0 to count(_items)-1 do {
_vehicle addWeaponCargoGlobal [_items select _i, _counts select _i];
};Apply the count(_items)-1 bound to all five confirmed old-shape loops. Current stable/B74.1/current B74.2, current B69/B74 and historical a96fdda2 already carry this shape in both maintained roots; current Miksuu b8389e748243 does not.
Optional guard if the code owner wants clearer empty-array behavior:
if (count _items > 0) then {
for '_i' from 0 to count(_items)-1 do {
_vehicle addWeaponCargoGlobal [_items select _i, _counts select _i];
};
};Keep the patch scoped:
- Do not redesign the buy-gear UI.
- Do not treat this as gear-purchase authority hardening.
- Do not combine with Gear template profile filter, even though both live in the gear UI area.
Source checks:
-
Common_EquipVehicle.sqfhas nofor '_i' from 0 to count(_items) doloops. -
Common_EquipBackpack.sqfhas nofor '_i' from 0 to count(_items) doloops. -
Client_GetVehicleContent.sqfstill usescount(_items)-1and does not regress. - Source Chernarus is patched first; Vanilla Takistan is propagated by LoadoutManager from a correctly named
a2waspwarfarecheckout.
Arma smoke:
- Add one weapon cargo item to a vehicle through Buy Gear and confirm exactly one appears.
- Add one magazine cargo item to a vehicle and confirm exactly one appears.
- Add one backpack cargo item to a vehicle and confirm exactly one appears.
- Add backpack weapon/magazine contents to a unit backpack and confirm contents apply without RPT out-of-range errors.
- Try empty cargo groups and confirm no RPT out-of-range errors.
On docs/source HEAD@c96ee1670ddb, Missions_Vanilla/[61-2hc]warfarev2_073v48co.takistan carries the same inclusive loops in Common_EquipVehicle.sqf and Common_EquipBackpack.sqf; checked cargo helper paths are source-unchanged from ebfdca96542f / b2544207. Current Miksuu b8389e748243 still matches that old shape; current stable/B74.1 origin/master@f8a76de34 / origin/claude/b74.1-aicom@f8a76de34, current B74.2 origin/claude/b74.2-aicom@21b62b04, current B69 origin/claude/b69@8d465fce, adjacent B74 origin/claude/b74-aicom-spend@b23f557f and historical release a96fdda2 already fix both maintained roots; perf 0076040f fixes Chernarus only.
Per project rules:
- Patch source Chernarus first.
- Use
Tools/LoadoutManagerfor Vanilla propagation. - Treat Napf/Eden/Lingor as divergent forks and other modded folders as stubs unless the owner chooses a maintenance model.
- This is a small, patch-ready reliability bug.
- It should be safe to patch independently from the server-authority/economy redesign because it only fixes loop bounds in cargo-application helpers.
- Keep this page paired with Gear/loadout/EASA atlas, Client UI systems atlas and Feature status.
- Branch check refreshed 2026-06-24: docs/source
HEAD@c96ee1670ddbis source-unchanged fromebfdca96542f/b2544207for checked cargo helper paths; docs/source, current Miksuub8389e748243and historical EASA QoLa66d4691still carry the five inclusive loops in both maintained roots. Current stable/B74.1origin/master@f8a76de34/origin/claude/b74.1-aicom@f8a76de34, current B74.2origin/claude/b74.2-aicom@21b62b04, current B69origin/claude/b69@8d465fce, adjacent B74origin/claude/b74-aicom-spend@b23f557fand historical releasea96fdda2fix both maintained roots; perf0076040ffixes Chernarus only. Checkedb2544207..HEAD,ebfdca96542f..HEAD,d472da6a..origin/claude/b74.2-aicom,origin/master..origin/claude/b74.2-aicomandorigin/claude/b69..origin/claude/b74-aicom-spendcargo deltas are empty. Current origin exposes no liverelease/*, cargo, equip or backpack rescue head; liveorigin/claude/trello-buymenu-gear-display@db1291bebaandorigin/claude/trello-easa-weapon-categories@08819118have no checked cargo-helper delta and are not cargo-loop rescue branches.d9506078is localorigin/claude/*evidence rather than current Miksuu upstream.
Previous: Gear template profile filter | Next: UI IDD collision repair
Main map: Home | Agent file: agent-feature-status.jsonl | Backlog: agent-hardening-backlog.jsonl
Home | Agent Guide | Current live state | Release 1.2.2 (B91) | Quickstart | Progress | Lifecycle wait-chain | Join/disconnect | Parameters/build | Assets/config | SQF atlas | PV index | Modules | Support/specials | Commander/HQ | Commander vote/reassign | Construction/CoIn | Construction cleanup | WDDM compositions | Factory/purchase | Upgrades/research | Towns/camps/capture | Victory/endgame | Markers/cleanup | Server runtime | AI runtime/HC | AI commander audit | HC delegation | Town AI safety | Commander reassignment | Resistance supply | Player UI workflow | UI atlas | Respawn/death | Gear template filter | Vehicle cargo loop | Service guards | UI IDD repair | UI design inspiration | WASP overlay | Feature status | Source propagation | release readiness | Tooling readiness | Integration trust | AntiStack DB | Owner decisions | Shelved registry | Abandoned feature revival | Hardening roadmap | PVF dispatch | Server authority | ICBM authority | Attack-wave authority | Telemetry families | AICOM V2 cutover | Consumer port map | Testing workflow | Server ops | Web tools | Ecosystem repos | Arma 2 OA refs | A2 traps | OA compatibility audit | Coverage ledger | Navigation inventory | Pruning ledger | Knowledge roadmap | Agent context | Collab protocol | Worklog | Audit archive 2026-07 | Briefing reference | Utes invasion concept
- Shelved AICOM concepts - revivable someday ideas (owner-shelved 2026-07-03)
Docs rule: source-backed claims only; Arma 2 OA scripting docs only; gameplay edits start in Missions/[55-2hc]warfarev2_073v48co.chernarus.
- Getting started
- Status and coordination
- Agent context
- Agent collaboration protocol
- Agent worklog
- Agent worklog archive
- Progress dashboard
- PR cleanup and integration lab
- Shelved PR #169: gear price double-count
- Shelved PR #194: Chernarus no-trees
- Coordination board
- Codebase coverage ledger
- Bottleneck removal queue
- Current source status
- Wiki mirror reconciliation
- Navigation inventory
- Registers
- Agent orchestration
- Architecture
- Architecture overview
- Mission entrypoints and lifecycle
- Lifecycle wait chain
- Player join/disconnect and AntiStack lifecycle
- Mission parameters/localization/build inputs
- Stringtable localization key-family catalog
- Source inventory
- Content structure and maps
- Assets/config/localization/parameters
- Mission start parameters index
- Code and networking
- Gameplay systems
- Core systems index
- Gameplay systems atlas
- Commander/HQ lifecycle atlas
- Economy, towns and supply
- Economy system reference
- Balance asymmetries
- Anti-stack skill-balance mechanic
- Empty-side supply income stagnation
- Towns, camps and capture atlas
- Victory and endgame atlas
- Victory conditions reference
- Territorial victory reference
- Marker cleanup and restoration
- Marker loop engine and registries
- Map marker families content catalog
- Marker subsystem function reference
- Client marker FSM updater map
- Support specials and tactical modules
- SCUD TEL tactical munitions
- Naval HVT objectives (carriers/SCUD)
- SCUD saturation strike mechanic
- Takistan airfield FPV drone design
- Construction and CoIn systems
- Structure damage reduction & friendly-fire
- Construction logic list cleanup
- Flak tower & WDDM anchor compositions
- Resistance supply scaffold
- GUER Insurgents faction overview
- GUER Insurgents branch audit
- GUER insurgent player economy
- GUER air-defense loop (Ka-137/Mi-24)
- Upgrades and research atlas
- Supply mission architecture
- Supply mission authority cleanup
- Current supply helicopters PR1
- Respawn and death-loop lifecycle
- Vehicle theft economy pitch
- GUER tunnel network pitch
- Content, reference and catalogs
- Faction unit/vehicle roster catalog
- Auxiliary/SF/civilian unit catalog
- Gear store loadout route catalog
- Upgrade research (cross-faction)
- Gear store price and upgrade catalog
- Gear store catalog (complete, per faction)
- Defense structures catalog
- Artillery reference per faction
- AI squad team templates catalog
- Town AI lifecycle reference
- Town AI group composition catalog
- Class-skill system reference
- Player skill abilities reference
- Default gear template content catalog
- Chernarus map content reference
- Takistan map content reference
- Takistan features
- Takistan parity reference
- Takistan oilfields objective reference
- IRS IR-smoke countermeasure
- Arty module special munitions
- Zeta cargo sling-load reference
- Spawn primitive function reference
- Kill and score pipeline
- Waypoint helper function reference
- Position and proximity function reference
- Side/team state function reference
- Player AI watchdog and recovery
- AICOM stuck-recovery v2
- LoadoutManager data-model contributor guide
- Discord status bot setup and reference
- GLOBALGAMESTATS extension reference
- New player quickstart (player guide)
- Optional client mods (player guide)
- Earning funds and score (player guide)
- Vehicle service and logistics (player guide)
- Commander's handbook (player guide)
- Tactical support menu
- Paradrop player experience
- Supply missions (player guide)
- In-game briefing & Diary field manual
- Playable maps catalog
- Faction root variables reference
- Faction base structures catalog
- Counter-battery radar system
- Bank, Reserve and Artillery Radar structures
- Map ruleset model and object config
- Countermeasures module reference
- Vehicle countermeasure (flares/spoofing)
- UAV terminal and spotter system
- Artillery firing function reference
- Service Point pricing model
- Medic redeployment truck (forward spawn)
- Side-patrol runtime and convoy mechanics
- Day/night cycle and weather system
- Config lookup helper reference
- CIPHER sort utilities reference
- Modded maps status and content
- BattlEye filter setup and OA taxonomy
- Player squad/group join protocol
- AutoFlip vehicle recovery
- Engine stealth fuel toggle
- Valhalla vehicle climbing-assist
- Missile and ordnance Fired-EH reference
- Vehicle equip and rearm reference
- Array and collection utilities
- Server composition spawner reference
- Upgrade queue server loop
- Map boundaries and off-map enforcement
- Namespace/profile/diagnostic utilities
- Group bool getVariable A2-OA trap
- Vehicle weapon balance init
- View distance auto-throttle
- Camp & respawn-camp getters
- Performance audit writer
- Site clearance (bulldozer)
- Factory queue cancel & refund
- AI commander tunable constants
- Experimental feature-flag constants
- Flag system quick reference
- Mission tunable constants catalog
- Gear parsing & cargo capacity
- Structure dressing function
- Paradrop delivery functions
- ICBM nuke client VFX & radiation
- Server HandleSpecial router
- LocalizeMessage chat router
- Gear buy-menu render & price functions
- Server broadcast & telemetry loops
- Per-unit client init pipeline
- Vehicle marking & texture pipeline
- Defense category & budget
- Legacy AI order primitives
- Commander-team driver
- AICOM command verbs
- AICOM behavior fix taxonomy
- AI commander wildcard deck reference
- AICOM aircraft and airfield system
- Static-defense manning
- End-of-game stats screen
- AI commander execution loop
- Deployable bipod / weapon resting
- Town-economy getters
- Server-init deadspawn & airfield probe
- GUER VBIED detonate action
- Resource income-tick engine
- AI commander treasury accessors
- PVF send-helper contracts
- AICOM logging & AICOMSTAT telemetry
- AICOMSTAT v2 event census
- WASPSCALE v2 telemetry
- WASPSCALE v2-ext coverage audit
- Telemetry families reference
- Group lifecycle & entity reaping
- Batch AI spawner orchestrator
- Client funds/income HUD readout
- Server group GC & cap warning
- Town runtime tuning constants
- Client input/hotkey handler
- WASP base-repair system
- WASP DropRPG launcher/ordnance
- CoIn construction-interface client engine
- Town-capture garrison & airfield rebuild
- Map-control & minimap templates
- Client FPS & state telemetry
- Client service-proximity getters
- Airfield-exclusive roster & unit hints
- Unit-camera spectator system
- Town-garrison patrol/defense worker
- RequestTeamUpdate squad-discipline
- Arma2Warfare GPT assistant
- LoadoutManager build configs & defines
- GLOBALGAMESTATS extension logging
- Discord bot instrumented logging
- Eden/Everon & Taviana map content
- Cruise missile strike asset
- AI / HC
- AI headless and performance
- AI mods and pathfinding reference
- Headless client scaling and topology
- AI runtime/HC loop map
- Headless client init and stat loop
- HC delegation target selection
- Player AI caps and role balance
- Old WarfareBE FPS comparison
- AI commander autonomy audit
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- AI commander capture & fun plan
- AI commander B69 improvement roadmap
- AI commander B69 implementation sketches
- AICOM V2 cutover status
- Headless delegation and failover
- Commander reassignment call shape
- GUER Director living-resistance pitch
- Quality and operations
- Foundation perf findings & Tier-3 dead-ends
- Dead/stale code register
- Commander vote/reassignment
- Attack-wave authority
- Server runtime and operations
- Server ops runbook
- JIP enrollment & client data delivery (b74.2 lessons)
- Server gameplay runtime atlas
- PerformanceAuditAnalyzer
- Performance opportunity sweep
- Documentation plan
- Knowledge platform roadmap
- Wiki quality audit
- Wiki pruning and relevance ledger
- Audit findings queue (2026-06-03)
- Deep review findings
- Client UI / server-loop perf findings
- Performance gain simulation
- Self-host testing field notes
- Cleanup and work lanes
- Hardening and authority
- UI / player workflows
- Client UI, HUD and menus
- UI HUD and dialogs
- Player UI workflow map
- Client UI systems atlas
- UI IDD collision repair
- UI control class library reference
- UI theme palette and style macros
- UI design inspiration 2026-07
- Available-actions client gate FSM
- Gear/loadout/EASA atlas
- Gear template profile filter
- Vehicle cargo equip loop bounds
- Factory and purchase systems atlas
- Service menu affordability guards
- WASP overlay
- Class-skill system reference
- Skin selector and class swap
- Earplugs audio toggle
- Mission audio catalog
- HQ radio knowledge-base catalog
- QoL trio player hints
- Player vehicle/travel actions
- Tooling / release / integrations
- Tools and build workflow
- Warfare web tools
- Ecosystem & companion repos
- Zargabad tooling parity
- July 2026 release readiness
- Operator monitor and CPU affinity tools
- Tooling release readiness audit
- Source fix propagation queue
- Agent release readiness ledger
- Release source intake map
- Testing/debugging/release workflow
- Current RPT release gate
- RPT telemetry consumer port map
- External integrations
- Integration trust boundary audit
- AntiStack database extension audit
- Community & Dev
- Community & Dev
- Miksuu upstream wiki import / archive index
- Upstream changelog feature leads
- Developer history and upstream lessons
- Upstream Miksuu commit intel
- Upstream mining ledger
- Archive script mining v2
- Upstream BE 2073 AICOM delta
- Parent 2.073 divergence audit
- PR8 and Drone upstream lesson match
- Development lessons learned
- External research reports
- Audit archive 2026-07
- Briefing reference
- Utes invasion concept
- Miksuu archive: Home
- Miksuu archive: Welcome
- Miksuu archive: Big announcements
- Miksuu archive: Changelog
- Miksuu archive: Development process
- Miksuu archive: Discord bot
- Miksuu archive: Gameplay videos
- Miksuu archive: LoadoutManager
- Miksuu archive: Chernarus script architecture
- Base-game visual catalogs
- Compatibility and references
- HC upstream history and lessons
- Player stats branch audit
- BuyMenu EASA QoL branch audit
- Perf quick wins branch audit
- Commander positions branch audit
- Zargabad branch audit
- Quad AI Commander concept
- Arma 2 OA external reference guide
- Base-game config & image reference
- Arma 2 OA compatibility audit
- Arma 2 OA agent traps reference
- Arma 2 OA command versions
- Wiki source consistency
- External Arma 2 OA reference index