Remove checking for SpriteComponent on the server (#16821)

This commit is contained in:
Julian Giebel 2023-05-26 00:17:48 +02:00 committed by GitHub
parent a647b30d16
commit 9f3f3b4998
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -73,7 +73,7 @@ namespace Content.MapRenderer.Painters
foreach (var entity in _sEntityManager.GetEntities())
{
if (!_sEntityManager.HasComponent<SpriteComponent>(entity))
if (!_cEntityManager.TryGetComponent(entity, out SpriteComponent? sprite))
{
continue;
}
@ -84,12 +84,6 @@ namespace Content.MapRenderer.Painters
continue;
}
if (!_cEntityManager.TryGetComponent(entity, out SpriteComponent? sprite))
{
throw new InvalidOperationException(
$"No sprite component found on an entity for which a server sprite component exists. Prototype id: {prototype.ID}");
}
var transform = _sEntityManager.GetComponent<TransformComponent>(entity);
if (_cMapManager.TryGetGrid(transform.GridUid, out var grid))
{