Server/Storage: allow specifying a radius for _areaInsert (#5001)
✨️ Pay no attention to the changes in trashbag.yml... they are merely an illusion... ✨️ t. 🧙♂️️
This commit is contained in:
@@ -56,6 +56,8 @@ namespace Content.Server.Storage.Components
|
||||
|
||||
[DataField("areaInsert")]
|
||||
private bool _areaInsert = false; // "Attacking" with the storage entity causes it to insert all nearby storables after a delay
|
||||
[DataField("areaInsertRadius")]
|
||||
private int _areaInsertRadius = 1;
|
||||
|
||||
[DataField("whitelist")]
|
||||
private EntityWhitelist? _whitelist = null;
|
||||
@@ -510,7 +512,7 @@ namespace Content.Server.Storage.Components
|
||||
if (_areaInsert && (eventArgs.Target == null || !eventArgs.Target.HasComponent<SharedItemComponent>()))
|
||||
{
|
||||
var validStorables = new List<IEntity>();
|
||||
foreach (var entity in IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(eventArgs.ClickLocation, 1))
|
||||
foreach (var entity in IoCManager.Resolve<IEntityLookup>().GetEntitiesInRange(eventArgs.ClickLocation, _areaInsertRadius))
|
||||
{
|
||||
if (entity.IsInContainer()
|
||||
|| entity == eventArgs.User
|
||||
|
||||
@@ -32,3 +32,22 @@
|
||||
areaInsert: true
|
||||
storageSoundCollection:
|
||||
collection: trashBagRustle
|
||||
|
||||
- type: entity
|
||||
name: spell of all-consuming cleanliness
|
||||
id: BagOfSummoningGarbage
|
||||
parent: BaseItem
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Objects/Specific/Janitorial/trashbag.rsi
|
||||
state: blue-icon-3
|
||||
- type: Item
|
||||
sprite: Objects/Specific/Janitorial/trashbag.rsi
|
||||
HeldPrefix: blue
|
||||
- type: Storage
|
||||
capacity: 125000
|
||||
quickInsert: true
|
||||
areaInsert: true
|
||||
areaInsertRadius: 1000
|
||||
storageSoundCollection:
|
||||
collection: trashBagRustle
|
||||
|
||||
Reference in New Issue
Block a user