(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

View File

@@ -276,9 +276,6 @@ namespace Barotrauma
characterInfos.Add(characterInfo);
}
characterInfos.Add(characterInfo);
}
/// <summary>
/// Remove the character from the crew (and crew menus).
/// </summary>

View File

@@ -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; }

View File

@@ -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();