Remove FoodContainer, add whitelists, replace with SpawnItemsOnUse (#4358)

This commit is contained in:
mirrorcult
2021-07-25 08:41:50 -07:00
committed by GitHub
parent ae84ba07e6
commit a91f919018
18 changed files with 253 additions and 260 deletions

View File

@@ -15,6 +15,7 @@ using Content.Shared.Item;
using Content.Shared.Notification;
using Content.Shared.Notification.Managers;
using Content.Shared.Storage;
using Content.Shared.Whitelist;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
@@ -47,10 +48,16 @@ namespace Content.Server.Storage.Components
[DataField("occludesLight")]
private bool _occludesLight = true;
[DataField("quickInsert")]
private bool _quickInsert; //Can insert storables by "attacking" them with the storage entity
private bool _quickInsert = false; // Can insert storables by "attacking" them with the storage entity
[DataField("areaInsert")]
private bool _areaInsert; //"Attacking" with the storage entity causes it to insert all nearby storables after a delay
private bool _areaInsert = false; // "Attacking" with the storage entity causes it to insert all nearby storables after a delay
[DataField("whitelist")]
private EntityWhitelist? _whitelist = null;
private bool _storageInitialCalculated;
private int _storageUsed;
[DataField("capacity")]
@@ -123,6 +130,11 @@ namespace Content.Server.Storage.Components
return false;
}
if (_whitelist != null && !_whitelist.IsValid(entity))
{
return false;
}
return true;
}