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:
Zylofan
2024-10-01 22:56:49 -04:00
committed by GitHub
parent 20aa14e4f7
commit 42a1e02261

View File

@@ -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)