From db749bcb6727c628aeed026529a6a9da9cd97efe Mon Sep 17 00:00:00 2001 From: Dvir Date: Wed, 22 Jan 2025 23:42:02 +0200 Subject: [PATCH] Cleanup --- .../Storage/EntitySystems/MagnetPickupSystem.cs | 11 ++++++++++- .../Entities/Objects/Specific/Salvage/ore_bag.yml | 6 +----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs index c91832c33d0..a0de771cf44 100644 --- a/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs +++ b/Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs @@ -78,6 +78,15 @@ public override void Update(float frameTime) if (_whitelistSystem.IsWhitelistFail(storage.Whitelist, near)) continue; + // FRONTIER - START + // Makes sure that after the last insertion, there is still bag space. + // Using a cheap 'how many slots left' vs 'how many we need' check, and additional stack check. + // Note: Unfortunately, this is still 'expensive' as it checks the entire bag, however its better than + // to rotate an item n^n times of every item in the bag to find the best fit, for every xy coordinate it has. + if (!_storage.HasSlotSpaceFor(uid, near)) + continue; + // FRONTIER - END + if (!_physicsQuery.TryGetComponent(near, out var physics) || physics.BodyStatus != BodyStatus.OnGround) continue; @@ -105,4 +114,4 @@ public override void Update(float frameTime) } } } -} \ No newline at end of file +} diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml index 9b0a4361f9f..31ca74a7af8 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/ore_bag.yml @@ -17,7 +17,7 @@ slots: - belt - type: Item - size: Huge # DeltaV: Was Ginormous, lets it fit in conscription bag + size: Ginormous - type: Storage maxItemSize: Normal grid: @@ -47,7 +47,3 @@ True: { state: icon_on } False: { state: icon } # End DeltaV Additions - - type: ReverseEngineering # DeltaV - difficulty: 2 - recipes: - - OreBagOfHolding