(91c5faef2) Item deterioration fixes
This commit is contained in:
@@ -276,6 +276,9 @@ namespace Barotrauma
|
|||||||
characterInfos.Add(characterInfo);
|
characterInfos.Add(characterInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
characterInfos.Add(characterInfo);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove the character from the crew (and crew menus).
|
/// Remove the character from the crew (and crew menus).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -201,31 +201,31 @@ namespace Barotrauma.Items.Components
|
|||||||
if (ic is PowerTransfer pt)
|
if (ic is PowerTransfer pt)
|
||||||
{
|
{
|
||||||
//power transfer items (junction boxes, relays) don't deteriorate if they're no carrying any power
|
//power transfer items (junction boxes, relays) don't deteriorate if they're no carrying any power
|
||||||
if (Math.Abs(pt.CurrPowerConsumption) < 0.1f) { return false; }
|
if (Math.Abs(pt.CurrPowerConsumption) > 0.1f) { return true; }
|
||||||
}
|
}
|
||||||
else if (ic is Engine engine)
|
else if (ic is Engine engine)
|
||||||
{
|
{
|
||||||
//engines don't deteriorate if they're not running
|
//engines don't deteriorate if they're not running
|
||||||
if (Math.Abs(engine.Force) < 1.0f) { return false; }
|
if (Math.Abs(engine.Force) > 1.0f) { return true; }
|
||||||
}
|
}
|
||||||
else if (ic is Pump pump)
|
else if (ic is Pump pump)
|
||||||
{
|
{
|
||||||
//pumps don't deteriorate if they're not running
|
//pumps don't deteriorate if they're not running
|
||||||
if (Math.Abs(pump.FlowPercentage) < 1.0f) { return false; }
|
if (Math.Abs(pump.FlowPercentage) > 1.0f) { return true; }
|
||||||
}
|
}
|
||||||
else if (ic is Reactor reactor)
|
else if (ic is Reactor reactor)
|
||||||
{
|
{
|
||||||
//reactors don't deteriorate if they're not powered up
|
//reactors don't deteriorate if they're not powered up
|
||||||
if (reactor.Temperature < 0.1f) { return false; }
|
if (reactor.Temperature > 0.1f) { return true; }
|
||||||
}
|
}
|
||||||
else if (ic is OxygenGenerator oxyGenerator)
|
else if (ic is OxygenGenerator oxyGenerator)
|
||||||
{
|
{
|
||||||
//oxygen generators don't deteriorate if they're not running
|
//oxygen generators don't deteriorate if they're not running
|
||||||
if (oxyGenerator.CurrFlow < 0.1f) { return false; }
|
if (oxyGenerator.CurrFlow > 0.1f) { return true; }
|
||||||
}
|
}
|
||||||
else if (ic is Powered powered)
|
else if (ic is Powered powered)
|
||||||
{
|
{
|
||||||
if (powered.Voltage < powered.MinVoltage) { return false; }
|
if (powered.Voltage >= powered.MinVoltage) { return true; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user