Prevents FloorOcclusion from breaking rendering (#25960)

* Prevents FloorOcclusion from breaking rendering

* Minor change
This commit is contained in:
DoutorWhite 2024-03-10 14:07:24 -03:00 committed by GitHub
parent 1eb2bcf455
commit 717da4a8f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,9 +43,14 @@ public sealed class FloorOcclusionSystem : SharedFloorOcclusionSystem
private void SetShader(SpriteComponent sprite, bool enabled)
{
var shader = _proto.Index<ShaderPrototype>("HorizontalCut").Instance();
if (sprite.PostShader is not null && sprite.PostShader != shader)
return;
if (enabled)
{
sprite.PostShader = _proto.Index<ShaderPrototype>("HorizontalCut").Instance();
sprite.PostShader = shader;
}
else
{