Validate that client prototypes are serializable (#18780)

This commit is contained in:
Leon Friedrich
2023-08-07 15:44:53 +12:00
committed by GitHub
parent 5c6013ab07
commit 5cc5a8c82e
5 changed files with 34 additions and 28 deletions

View File

@@ -28,19 +28,12 @@ public sealed class AtmosPipeAppearanceSystem : EntitySystem
if (!TryComp(uid, out SpriteComponent? sprite))
return;
if (!_resCache.TryGetResource(SpriteSpecifierSerializer.TextureRoot / component.RsiPath, out RSIResource? rsi))
{
Logger.Error($"{nameof(AtmosPipeAppearanceSystem)} could not load to load RSI {component.RsiPath}.");
return;
}
foreach (PipeConnectionLayer layerKey in Enum.GetValues(typeof(PipeConnectionLayer)))
{
sprite.LayerMapReserveBlank(layerKey);
var layer = sprite.LayerMapGet(layerKey);
sprite.LayerSetRSI(layer, rsi.RSI);
var layerState = component.State;
sprite.LayerSetState(layer, layerState);
sprite.LayerSetRSI(layer, component.Sprite.RsiPath);
sprite.LayerSetState(layer, component.Sprite.RsiState);
sprite.LayerSetDirOffset(layer, ToOffset(layerKey));
}
}