Skip to content

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

Merged
mibac138 merged 1 commit into
rwmt:devfrom
cmlee119:fix/drafted-goto-endjob-desync
Jul 22, 2026
Merged

mibac138 merged 1 commit into
rwmt:devfrom
cmlee119:fix/drafted-goto-endjob-desync

Conversation

@cmlee119

Copy link
Copy Markdown
Contributor

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.

@mibac138 mibac138 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR

@mibac138
mibac138 merged commit a481546 into rwmt:dev Jul 22, 2026
CormacOConnor72 added a commit to CormacOConnor72/Multiplayer that referenced this pull request Jul 22, 2026
Feedback.cs: kept this branch's PawnGotoAction EndCurrentJob sync, which matches
upstream rwmt#957 but adds a transpiler call-count check and only ends the pawn's
job if it is still the Goto this order targeted (the synced command runs ticks
after the click, so the pawn may have started an unrelated job since).
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.

2 participants