]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Don't reload parallax prototypes unless necessary (#14763)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 22 Mar 2023 01:38:29 +0000 (12:38 +1100)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2023 01:38:29 +0000 (12:38 +1100)
Content.Client/Parallax/ParallaxSystem.cs

index 96d756aa7fd91f84ac11787abf62bfd3d7f05109..a3d86743db0a445b286628adc156caf00a5c2644 100644 (file)
@@ -1,3 +1,4 @@
+using Content.Client.Parallax.Data;
 using Content.Client.Parallax.Managers;
 using Content.Shared.Parallax;
 using Robust.Client.Graphics;
@@ -27,6 +28,9 @@ public sealed class ParallaxSystem : SharedParallaxSystem
 
     private void OnReload(PrototypesReloadedEventArgs obj)
     {
+        if (!obj.ByType.ContainsKey(typeof(ParallaxPrototype)))
+            return;
+
         _parallax.UnloadParallax(Fallback);
         _parallax.LoadDefaultParallax();