(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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user