Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Jan 22, 2025
1 parent f2afa1e commit db749bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
11 changes: 10 additions & 1 deletion Content.Shared/Storage/EntitySystems/MagnetPickupSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -105,4 +114,4 @@ public override void Update(float frameTime)
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -47,7 +47,3 @@
True: { state: icon_on }
False: { state: icon }
# End DeltaV Additions
- type: ReverseEngineering # DeltaV
difficulty: 2
recipes:
- OreBagOfHolding

0 comments on commit db749bc

Please sign in to comment.