Skip to content

Fix drafted-move desync from unsynced EndCurrentJob in PawnGotoAction#957

Open
cmlee119 wants to merge 1 commit into
rwmt:devfrom
cmlee119:fix/drafted-goto-endjob-desync
Open

Fix drafted-move desync from unsynced EndCurrentJob in PawnGotoAction#957
cmlee119 wants to merge 1 commit into
rwmt:devfrom
cmlee119:fix/drafted-goto-endjob-desync

Conversation

@cmlee119

Copy link
Copy Markdown

Fixes #849.

PawnGotoAction runs once per pawn on the client that issues a drafted move order. We already sync its TryTakeOrderedJob call, but it has another path: when a pawn is already standing on gotoLoc and its current job is Goto, it calls Pawn_JobTracker.EndCurrentJob directly. That call isn't synced, so the pawn stops only for the player who issued the order while it keeps walking for everyone else, causing a desync.

This redirects that EndCurrentJob call to a synced wrapper through the existing DraftedMove_GotoFeedbackPatch transpiler, the same way the TryTakeOrderedJob call is handled — the first solution proposed in #849.

Repro: draft a group, give a long move order, then while they're still walking re-issue a move onto the cells they're currently standing on. Desynced 3/3 for me; with this change I couldn't reproduce it in 10 attempts. I've also been running it as a small separate mod in our ongoing multiplayer game with no issues so far.

When a group of drafted pawns is given a move order, PawnGotoAction runs
once per pawn on the client that issued the order. We already sync its
TryTakeOrderedJob call, but it has another path: when a pawn is already
standing on gotoLoc and its current job is Goto, it calls
Pawn_JobTracker.EndCurrentJob directly. That call isn't synced, so the
pawn stops only for the player who issued the order while it keeps walking
for everyone else, causing a desync.

Redirect that EndCurrentJob call to a synced wrapper through the existing
DraftedMove_GotoFeedbackPatch transpiler, the same way the
TryTakeOrderedJob call in the same method is already handled.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant