Skip to content

FloatMenuOptionProvider_DraftedMove:PawnGotoAction can cause desyncs #849

@SokyranTheDragon

Description

@SokyranTheDragon

If called from interface, the method FloatMenuOptionProvider_DraftedMove:PawnGotoAction can cause desyncs.

We already handle 1 possible desync caused by this method - the call to Pawn_JobTracker:TryTakeOrderedJob is wrapped by a sync method using a transpiler (DraftedMove_GotoFeedbackPatch).

However, the 2nd possible desync isn't handled by us at the moment. If the pawn's current position is the same as the IntVec3 gotoLoc argument passed to the method, and their current job is Goto, it'll call Pawn_JobTracker:EndCurrentJob method, causing the pawn to stop moving. However, since this call isn't synced, the pawn will only stop for the player performing this interaction - for others the pawn will continue walking towards their intended target.

As for solutions - we can fix it by wrapping and syncing the call the same way we handle the other dangerous call. Alternatively, we could wrap sync Pawn_JobTracker:EndCurrentJob call... however, given we still haven't done that, I feel doing so for 1 small edge case may be an overkill. In which case I'd propose we go with the first solution to this issue.

Any opinions as for the approach I've proposed? If nobody has anything against it, and has no ideas/proposals for better solutions, I'll go ahead and prepare a PR with the changes I've proposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.6Fixes or bugs relating to 1.6 (Not Odyssey).desyncBug that specifically causes a desynced state.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions