(9c93ed664) Fixed fabricators and deconstructors deteriorating when they're powered (not just when fabricating/deconstructing) something

This commit is contained in:
Joonas Rikkonen
2019-04-08 19:16:23 +03:00
parent d482e6554d
commit e19bf22112
3 changed files with 21 additions and 4 deletions
@@ -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; }