-
-
Notifications
You must be signed in to change notification settings - Fork 137
Description
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.