Merge branch 'master' of https://github.com/Regalis11/Barotrauma.git
This commit is contained in:
@@ -1030,7 +1030,7 @@ namespace Barotrauma
|
||||
|
||||
const int maxDist = 1000;
|
||||
|
||||
if (level != null)
|
||||
if (level != null && !level.Removed)
|
||||
{
|
||||
foreach (var ruin in level.Ruins)
|
||||
{
|
||||
|
||||
@@ -79,17 +79,18 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
bool sendOutput = true;
|
||||
bool state = true;
|
||||
for (int i = 0; i < timeSinceReceived.Length; i++)
|
||||
{
|
||||
if (timeSinceReceived[i] > timeFrame) { sendOutput = false; }
|
||||
if (timeSinceReceived[i] > timeFrame) { state = false; }
|
||||
timeSinceReceived[i] += deltaTime;
|
||||
}
|
||||
|
||||
string signalOut = sendOutput ? output : falseOutput;
|
||||
string signalOut = state ? output : falseOutput;
|
||||
if (string.IsNullOrEmpty(signalOut))
|
||||
{
|
||||
IsActive = false;
|
||||
//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; }
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,17 +12,18 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
bool sendOutput = false;
|
||||
bool state = false;
|
||||
for (int i = 0; i < timeSinceReceived.Length; i++)
|
||||
{
|
||||
if (timeSinceReceived[i] <= timeFrame) { sendOutput = true; }
|
||||
if (timeSinceReceived[i] <= timeFrame) { state = true; }
|
||||
timeSinceReceived[i] += deltaTime;
|
||||
}
|
||||
|
||||
string signalOut = sendOutput ? output : falseOutput;
|
||||
string signalOut = state ? output : falseOutput;
|
||||
if (string.IsNullOrEmpty(signalOut))
|
||||
{
|
||||
IsActive = false;
|
||||
//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; }
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,17 +12,19 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
public override void Update(float deltaTime, Camera cam)
|
||||
{
|
||||
int sendOutput = 0;
|
||||
int receivedInputs = 0;
|
||||
for (int i = 0; i < timeSinceReceived.Length; i++)
|
||||
{
|
||||
if (timeSinceReceived[i] <= timeFrame) { sendOutput += 1; }
|
||||
if (timeSinceReceived[i] <= timeFrame) { receivedInputs += 1; }
|
||||
timeSinceReceived[i] += deltaTime;
|
||||
}
|
||||
|
||||
string signalOut = sendOutput == 1 ? output : falseOutput;
|
||||
bool state = receivedInputs == 1;
|
||||
string signalOut = state ? output : falseOutput;
|
||||
if (string.IsNullOrEmpty(signalOut))
|
||||
{
|
||||
IsActive = false;
|
||||
//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; }
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user