]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Seismic charge now craftable (#32459)
authorZylofan <80375291+Zylofan@users.noreply.github.com>
Wed, 2 Oct 2024 02:56:49 +0000 (22:56 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Oct 2024 02:56:49 +0000 (20:56 -0600)
* 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

Content.Shared/Materials/SharedMaterialStorageSystem.cs

index dc4858fd7458dd4eeaedd8caa2c4a06a2ccbcd32..01539936b95b10c216075ba08d29ace41bfa7275 100644 (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)