From effcbd93c6c3b82c60557d8ca4f0bfb7987aa97a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 9 Jun 2019 17:37:07 +0300 Subject: [PATCH] (ea3b77d8a) Fixed servers not sending a hull update when the last fire source in the hull is put out. Caused the fire not to disappear client-side until the water/oxygen in the hull changes enough for a network event to be created. --- Barotrauma/BarotraumaServer/Source/Map/Hull.cs | 4 +++- Barotrauma/BarotraumaShared/Source/PlayerInput.cs | 15 --------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Barotrauma/BarotraumaServer/Source/Map/Hull.cs b/Barotrauma/BarotraumaServer/Source/Map/Hull.cs index 3fc9ec6d3..b94b26693 100644 --- a/Barotrauma/BarotraumaServer/Source/Map/Hull.cs +++ b/Barotrauma/BarotraumaServer/Source/Map/Hull.cs @@ -9,7 +9,7 @@ namespace Barotrauma { partial class Hull : MapEntity, ISerializableEntity, IServerSerializable, IClientSerializable { - private float lastSentVolume, lastSentOxygen; + private float lastSentVolume, lastSentOxygen, lastSentFireCount; private float sendUpdateTimer; public override bool IsMouseOn(Vector2 position) @@ -34,6 +34,7 @@ namespace Barotrauma //or if oxygen percentage has changed by 5% if (Math.Abs(lastSentVolume - waterVolume) > Volume * 0.1f || Math.Abs(lastSentOxygen - OxygenPercentage) > 5f || + lastSentFireCount != FireSources.Count || FireSources.Count > 0) { sendUpdateTimer -= deltaTime; @@ -42,6 +43,7 @@ namespace Barotrauma GameMain.NetworkMember.CreateEntityEvent(this); lastSentVolume = waterVolume; lastSentOxygen = OxygenPercentage; + lastSentFireCount = FireSources.Count; sendUpdateTimer = NetConfig.HullUpdateInterval; } } diff --git a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs index 2b1d6f7c3..d8e53f5e6 100644 --- a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs +++ b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs @@ -184,21 +184,6 @@ namespace Barotrauma } #endif - public KeyOrMouse State - { - get { return binding; } - } - - public void SetState() - { - hit = binding.IsHit(); - if (hit) hitQueue = true; - - held = binding.IsDown(); - if (held) heldQueue = true; - } -#endif - public bool Hit { get