Skip to content

Fix MultiplayerCompat for 1.6#4505

Open
Sakura-TA wants to merge 1 commit intoCombatExtended-Continued:Developmentfrom
Sakura-TA:Development
Open

Fix MultiplayerCompat for 1.6#4505
Sakura-TA wants to merge 1 commit intoCombatExtended-Continued:Developmentfrom
Sakura-TA:Development

Conversation

@Sakura-TA
Copy link

@Sakura-TA Sakura-TA commented Mar 17, 2026

Additions

Added MpCompat patch for GizmoAmmoStatus to sync the ammo-to-reload threshold value, which determines the minimum remaining ammo count at which a pawn will automatically reload

Changes

Replaced [SyncWorker] attribute registration with MP.RegisterSyncWorker for CompAmmoUser sync worker to fix compatibility with RimWorld 1.6
Added null check for Dialog_ManageLoadouts window in RemoveLoadout to prevent null reference exception when the dialog is not open

References

Contributes towards Multiplayer compatibility for CombatExtended

Reasoning

GizmoAmmoStatus ammo-to-reload threshold (TryReloadOn) needs to be synced so all players see and agree on when a pawn will trigger an automatic reload
Without this sync, one player adjusting the reload threshold on a shared pawn would not be seen by other players, causing inconsistent reload behavior
[SyncWorker] attribute registration broke in RimWorld 1.6, replacing with direct MP.RegisterSyncWorker call fixes this
RemoveLoadout could crash when executed as a synced command if Dialog_ManageLoadouts was not open on that client

Alternatives

Not syncing GizmoAmmoStatus threshold — players adjusting the reload slider on the same pawn would see different values and the pawn would behave inconsistently for each player

Testing

Compiles without warnings
Game runs without errors
(For compatibility patches) ...with and without patched mod loaded
Playtested a colony (1 day, tested all sync functionality)

@Sakura-TA Sakura-TA requested review from a team as code owners March 17, 2026 19:01
@github-actions
Copy link

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-23211546202.zip

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Mar 17, 2026
@Sakura-TA Sakura-TA changed the title Fix MultiplayerCompat for 1.6 & fix Loatout Fix MultiplayerCompat for 1.6 Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Download in Comments This PR has a zipfile download available.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant