Make SpriteSpecifier.Texture fail validation if it contains ".rsi" (#6155)

No pointing to PNGs inside RSIs.
This commit is contained in:
Pieter-Jan Briers
2025-09-02 22:05:13 +02:00
committed by GitHub
parent c2c8af16d0
commit f02cd0083a

View File

@@ -112,7 +112,11 @@ namespace Robust.Shared.Serialization.TypeSerializers.Implementations
IDependencyCollection dependencies,
ISerializationContext? context)
{
return serializationManager.ValidateNode<ResPath>(new ValueDataNode($"{TextureRoot / node.Value}"), context);
var path = TextureRoot / node.Value;
if (path.ToString().Contains(".rsi/"))
return new ErrorNode(node, "Texture paths may not be inside RSI files.");
return serializationManager.ValidateNode<ResPath>(new ValueDataNode(path.ToString()), context);
}
ValidationNode ITypeValidator<SpriteSpecifier, MappingDataNode>.Validate(