Seismic charge now craftable (#32459)
* when tryInsertBlueprint is called it now also calls UpdateMaterialWhitelist on the ent so that it can accept new materials if needed. * Changed the previous commit to now just have sharedMaterialStorageSystem subscribe to TechnologyDatabaseModifiedEvent which will call UpdateMaterialWhitelist. * Empty-Commit
This commit is contained in:
@@ -8,6 +8,7 @@ using JetBrains.Annotations;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using Content.Shared.Research.Components;
|
||||
|
||||
namespace Content.Shared.Materials;
|
||||
|
||||
@@ -34,6 +35,7 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing);
|
||||
SubscribeLocalEvent<MaterialStorageComponent, TechnologyDatabaseModifiedEvent>(OnDatabaseModified);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -312,6 +314,11 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
args.Handled = TryInsertMaterialEntity(args.User, args.Used, uid, component);
|
||||
}
|
||||
|
||||
private void OnDatabaseModified(Entity<MaterialStorageComponent> ent, ref TechnologyDatabaseModifiedEvent args)
|
||||
{
|
||||
UpdateMaterialWhitelist(ent);
|
||||
}
|
||||
|
||||
public int GetSheetVolume(MaterialPrototype material)
|
||||
{
|
||||
if (material.StackEntity == null)
|
||||
|
||||
Reference in New Issue
Block a user