From d8b194d249e92a9dbc875642ee8197226dccd894 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 8 Apr 2019 19:15:41 +0300 Subject: [PATCH] (91c5faef2) Item deterioration fixes --- .../Source/GameSession/CrewManager.cs | 3 +++ .../Source/Items/Components/Repairable.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index 1a7eaf05b..6b9d55aee 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -276,6 +276,9 @@ namespace Barotrauma characterInfos.Add(characterInfo); } + characterInfos.Add(characterInfo); + } + /// /// Remove the character from the crew (and crew menus). /// diff --git a/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs b/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs index 867a6c724..b67747e61 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs @@ -201,31 +201,31 @@ namespace Barotrauma.Items.Components if (ic is PowerTransfer pt) { //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) { //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) { //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) { //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) { //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) { - if (powered.Voltage < powered.MinVoltage) { return false; } + if (powered.Voltage >= powered.MinVoltage) { return true; } } }