(7e8f246d2) Fixed clients not seeing turrets rotating at their end when another client is operating the turret. Happened because the cursor position was only synced when the aim key was pressed, and aiming is not required anymore when using turrets.

This commit is contained in:
Joonas Rikkonen
2019-05-23 15:16:42 +03:00
parent 5392a8b0d7
commit 65eb8f35c9
3 changed files with 14 additions and 22 deletions
@@ -181,13 +181,11 @@ namespace Barotrauma
bool attackInput = msg.ReadBoolean();
keys[(int)InputType.Attack].Held = attackInput;
keys[(int)InputType.Attack].SetState(false, attackInput);
if (aimInput)
{
double aimAngle = ((double)msg.ReadUInt16() / 65535.0) * 2.0 * Math.PI;
cursorPosition = AimRefPosition + new Vector2((float)Math.Cos(aimAngle), (float)Math.Sin(aimAngle)) * 60.0f;
TransformCursorPos();
}
double aimAngle = msg.ReadUInt16() / 65535.0 * 2.0 * Math.PI;
cursorPosition = AimRefPosition + new Vector2((float)Math.Cos(aimAngle), (float)Math.Sin(aimAngle)) * 60.0f;
TransformCursorPos();
bool ragdollInput = msg.ReadBoolean();
keys[(int)InputType.Ragdoll].Held = ragdollInput;
keys[(int)InputType.Ragdoll].SetState(false, ragdollInput);