Unstable v0.19.5.0

This commit is contained in:
Juan Pablo Arce
2022-09-14 12:47:17 -03:00
parent 3f2c843247
commit 1fd2a51bbb
158 changed files with 5702 additions and 4813 deletions
@@ -64,6 +64,8 @@ namespace Barotrauma.Items.Components
private const float MinZoom = 1.0f, MaxZoom = 4.0f;
private float zoom = 1.0f;
/// <remarks>Accessed through event actions. Do not remove even if there are no references in code.</remarks>
public bool UseDirectionalPing => useDirectionalPing;
private bool useDirectionalPing = false;
private Vector2 pingDirection = new Vector2(1.0f, 0.0f);
private bool useMineralScanner;
@@ -82,9 +82,14 @@ namespace Barotrauma.Items.Components
public sealed override void Update(float deltaTime, Camera cam)
{
int receivedInputs = 0;
bool allInputsTimedOut = true;
for (int i = 0; i < timeSinceReceived.Length; i++)
{
if (timeSinceReceived[i] <= timeFrame) { receivedInputs += 1; }
if (timeSinceReceived[i] <= timeFrame)
{
allInputsTimedOut = false;
receivedInputs += 1;
}
timeSinceReceived[i] += deltaTime;
}
@@ -93,7 +98,7 @@ namespace Barotrauma.Items.Components
if (string.IsNullOrEmpty(signalOut))
{
//deactivate the component if state is false and there's no false output (will be woken up by non-zero signals in ReceiveSignal)
if (!state) { IsActive = false; }
if (!state && allInputsTimedOut) { IsActive = false; }
return;
}
@@ -58,6 +58,9 @@ namespace Barotrauma.Items.Components
}
}
public bool WaterDetected => isInWater;
public int WaterPercentage => GetWaterPercentage(item.CurrentHull);
public WaterDetector(Item item, ContentXElement element)
: base(item, element)
{