From 47940dc7441726320fc84e823fef0c6974781a94 Mon Sep 17 00:00:00 2001 From: ElectroJr Date: Mon, 13 Jan 2025 18:12:48 +1300 Subject: [PATCH] tests --- .../GameObjects/Components/Renderable/SpriteComponent.cs | 3 ++- Robust.Client/GameObjects/EntitySystems/SpriteSystem.Layer.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs b/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs index 1c5470aaee3..f99300835c6 100644 --- a/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs +++ b/Robust.Client/GameObjects/Components/Renderable/SpriteComponent.cs @@ -459,7 +459,8 @@ public void RemoveLayer(object layerKey) [Obsolete("Use SpriteSystem.RebuildBounds() instead.")] internal void RebuildBounds() { - if (entities.Initialized && entities.TrySystem(out SpriteSystem? sys)) + // I Love ISerializationHooks & inconsistent initialization ordering between server, client, and tests. + if (entities.Started && entities.TrySystem(out SpriteSystem? sys)) sys.RebuildBounds((Owner, this)); } diff --git a/Robust.Client/GameObjects/EntitySystems/SpriteSystem.Layer.cs b/Robust.Client/GameObjects/EntitySystems/SpriteSystem.Layer.cs index b2d589f7a88..29d9e79f232 100644 --- a/Robust.Client/GameObjects/EntitySystems/SpriteSystem.Layer.cs +++ b/Robust.Client/GameObjects/EntitySystems/SpriteSystem.Layer.cs @@ -111,7 +111,7 @@ public int AddLayer(Entity sprite, Layer layer, int? index = n sprite.Comp.Layers.Add(layer); } - sprite.Comp.RebuildBounds(); + RebuildBounds(sprite!); sprite.Comp.QueueUpdateIsInert(); return index.Value; }