Unstable v0.19.5.0
This commit is contained in:
@@ -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;
|
||||
|
||||
+7
-2
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user