toggle internals icon uses back internals (#12478)

This commit is contained in:
Justin Trotter
2022-12-06 17:14:08 -06:00
committed by GitHub
parent 05e85e5de6
commit ef5b2a19fa

View File

@@ -215,12 +215,20 @@ public sealed class InternalsSystem : EntitySystem
public GasTankComponent? FindBestGasTank(InternalsComponent component)
{
// Prioritise
// 1. exo-slot tanks
// 2. in-hand tanks
// 3. pocket/belt tanks
// 1. back equipped tanks
// 2. exo-slot tanks
// 3. in-hand tanks
// 4. pocket/belt tanks
InventoryComponent? inventory = null;
ContainerManagerComponent? containerManager = null;
if (_inventory.TryGetSlotEntity(component.Owner, "back", out var backEntity, inventory, containerManager) &&
TryComp<GasTankComponent>(backEntity, out var backGasTank) &&
_gasTank.CanConnectToInternals(backGasTank))
{
return backGasTank;
}
if (_inventory.TryGetSlotEntity(component.Owner, "suitstorage", out var entity, inventory, containerManager) &&
TryComp<GasTankComponent>(entity, out var gasTank) &&
_gasTank.CanConnectToInternals(gasTank))