Repository navigation
fix(coop): base equipment screens hand out starting gear in item-id order - #239
Merged
Merged
Conversation
…g gear on both machines Opens the Soldiers inventory and the craft equipment screen on the host and the client at once, from a SHARED world where every soldier's layout is empty, and compares what auto-equip gives each soldier. The order of the screen's item pool comes from each game's memory layout, so one boot shows the difference only some of the time; the rows count over eight fresh boots. Fails on the current build.
…rder An item container is keyed by item rule pointer, so walking it follows memory addresses. Those differ between launches and between the two co-op machines, so the Soldiers inventory and craft equipment screens auto-equipped the same soldier with different gear on the host and the client. The base screens now list each container's items by item id before building the auto-equip pool. That is the order containers had while they were keyed by item name, and the order vanilla OpenXcom still uses. Battle start keeps the container's own order.
NonPolynomialTim
enabled auto-merge (squash)
November 7, 2026 08:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When the Soldiers inventory screen or a craft equipment screen opens, every soldier without a saved layout is auto-equipped from the base or craft items. In co-op, the host and the client often showed the same soldier carrying different gear.
Item containers are keyed by item rule pointer, so walking one follows memory addresses. Those differ between launches and between the two machines, so the auto-equip pool came out in a different order on each.
Fix
On the two base screens, each container's items are listed by item id before the pool is built. That is the order containers had while they were keyed by item name, and the order vanilla OpenXcom still uses. Battle start keeps the container's own order. Solo base screens get the same order as co-op.
Tests
test_shared_base_autoequip_parity: both machines open each screen at once and compare every soldier's gear, over 8 fresh SHARED boots per run.test_shared_base_equip,test_coop_peer_equip_screens,test_unload_weapon_crash,test_coop_transferred_equipment,test_practice_rejoin,test_separate_single_world,test_landing_reply_practice,test_base_partner_view,test_shared_craft_loads.