rwmt / Multiplayer

Zetrith's Multiplayer mod for RimWorld
MIT License
481 stars 98 forks source link

Fix desyncs due to CompCableConnection motes, fixes #447 #481

Closed SokyranTheDragon closed 4 months ago

SokyranTheDragon commented 4 months ago

The method calls random whenever the mote is null or destroyed. There may be situations where the mote ends up being created late or destroyed for some players, but not the others. This is guaranteed to happen when playing with multiple maps, and seems like it may happen when the game is not paused when someone is joining.

Since the desync happens due to RNG call to randomize the mote position, this change should fix it by pushing/popping the RNG state before/after the method is called.