toggle internals icon uses back internals (#12478)
This commit is contained in:
@@ -215,12 +215,20 @@ public sealed class InternalsSystem : EntitySystem
|
|||||||
public GasTankComponent? FindBestGasTank(InternalsComponent component)
|
public GasTankComponent? FindBestGasTank(InternalsComponent component)
|
||||||
{
|
{
|
||||||
// Prioritise
|
// Prioritise
|
||||||
// 1. exo-slot tanks
|
// 1. back equipped tanks
|
||||||
// 2. in-hand tanks
|
// 2. exo-slot tanks
|
||||||
// 3. pocket/belt tanks
|
// 3. in-hand tanks
|
||||||
|
// 4. pocket/belt tanks
|
||||||
InventoryComponent? inventory = null;
|
InventoryComponent? inventory = null;
|
||||||
ContainerManagerComponent? containerManager = 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) &&
|
if (_inventory.TryGetSlotEntity(component.Owner, "suitstorage", out var entity, inventory, containerManager) &&
|
||||||
TryComp<GasTankComponent>(entity, out var gasTank) &&
|
TryComp<GasTankComponent>(entity, out var gasTank) &&
|
||||||
_gasTank.CanConnectToInternals(gasTank))
|
_gasTank.CanConnectToInternals(gasTank))
|
||||||
|
|||||||
Reference in New Issue
Block a user