Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr committed Jan 13, 2025
1 parent 86dfefa commit 47940dc
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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));
}

Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ public int AddLayer(Entity<SpriteComponent?> sprite, Layer layer, int? index = n
sprite.Comp.Layers.Add(layer);
}

sprite.Comp.RebuildBounds();
RebuildBounds(sprite!);
sprite.Comp.QueueUpdateIsInert();
return index.Value;
}

0 comments on commit 47940dc

Please sign in to comment.