Reactors, sonars, nav terminals, pumps and batteries use similar delayed correction logic as doors and inventories.
I.e. the clients delay correcting the state of the item until the local player stops manipulating the state (atm the delay is 1 sec). Prevents pumping speeds, steering directions and whatnot from switching to an old state and back - now the corrections should not be visible to the players unless the client predicts the state wrong.
This commit is contained in:
@@ -514,7 +514,7 @@ namespace Barotrauma.Items.Components
|
||||
PlaySound(ActionType.OnUse, item.WorldPosition);
|
||||
|
||||
predictedState = open;
|
||||
resetPredictionTimer = 1.0f;
|
||||
resetPredictionTimer = CorrectionDelay;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -523,7 +523,6 @@ namespace Barotrauma.Items.Components
|
||||
isOpen = open;
|
||||
}
|
||||
|
||||
|
||||
//opening a partially stuck door makes it less stuck
|
||||
if (isOpen) stuck = MathHelper.Clamp(stuck - 30.0f, 0.0f, 100.0f);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user