From e19bf22112062c531ccc250dde3176734755985c Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 8 Apr 2019 19:16:23 +0300 Subject: [PATCH] (9c93ed664) Fixed fabricators and deconstructors deteriorating when they're powered (not just when fabricating/deconstructing) something --- .../Source/GameSession/CrewManager.cs | 3 --- .../Source/Items/Components/Repairable.cs | 7 ++++++- Barotrauma/BarotraumaShared/Source/PlayerInput.cs | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs index 6b9d55aee..1a7eaf05b 100644 --- a/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs +++ b/Barotrauma/BarotraumaClient/Source/GameSession/CrewManager.cs @@ -276,9 +276,6 @@ 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 b67747e61..706317e0e 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Components/Repairable.cs @@ -198,7 +198,12 @@ namespace Barotrauma.Items.Components if (LastActiveTime > Timing.TotalTime) { return true; } foreach (ItemComponent ic in item.Components) { - if (ic is PowerTransfer pt) + if (ic is Fabricator || ic is Deconstructor) + { + //fabricators and deconstructors rely on LastActiveTime + return false; + } + else 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 true; } diff --git a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs index 453699c4a..25eeb36c5 100644 --- a/Barotrauma/BarotraumaShared/Source/PlayerInput.cs +++ b/Barotrauma/BarotraumaShared/Source/PlayerInput.cs @@ -153,6 +153,21 @@ namespace Barotrauma get { return binding; } } + public void SetState() + { + hit = binding.IsHit(); + if (hit) hitQueue = true; + + held = binding.IsDown(); + if (held) heldQueue = true; + } +#endif + + public KeyOrMouse State + { + get { return binding; } + } + public void SetState() { hit = binding.IsHit();