Fix MultiplayerCompat for 1.6#4505
Open
Sakura-TA wants to merge 1 commit intoCombatExtended-Continued:Developmentfrom
Open
Fix MultiplayerCompat for 1.6#4505Sakura-TA wants to merge 1 commit intoCombatExtended-Continued:Developmentfrom
Sakura-TA wants to merge 1 commit intoCombatExtended-Continued:Developmentfrom
Conversation
|
You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-23211546202.zip |
4 tasks
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.
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)