Don't reload parallax prototypes unless necessary (#14763)

This commit is contained in:
metalgearsloth 2023-03-22 12:38:29 +11:00 committed by GitHub
parent b4502757a5
commit 776d2df6bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View 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();