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
|
||||
|
||||
Reference in New Issue
Block a user