RobustToolbox
RobustToolbox copied to clipboard
Predict component adding and removal
Currently waiting on #3000
Fixes #2144. Required for, and tested in-game using space-wizards/space-station-14/pull/8475.
I might just not properly understand the gamestate manager/processor, but I think that when _waitingForFull is true it uses the wrong tick when calling ResetPredictedEntities()? Or more generally, because CurTick is sometimes set inside ProcessTickStates() before the predicted entities are reset, using ResetPredictedEntities(_timing.CurTick) is generally wrong?
I am no longer sure about the differences between GameStateProcessor.LastProcessedRealState, ClientGameStateManager.CurServerTick (aka _lastProcessedTick), IGameTiming.LastRealTick, and how they relate to IGameTiming.CurTick.
I'm not sure why LastProcessedRealState and CurTick are being set by ProcessTickStates() before the states are applied, because without also updating LastRealTick. it results in IGameTiming.InPrediction being true while applying states, which it really shouldn't be.
Somebody please help.