Make item rsis overwrite sprite rsis for inhandvisuals (#16714)

This commit is contained in:
Nemanja
2023-05-23 06:02:13 -04:00
committed by GitHub
parent 2e979aefa6
commit 40c6c1c3ae

View File

@@ -348,9 +348,11 @@ namespace Content.Client.Hands.Systems
// In case no RSI is given, use the item's base RSI as a default. This cuts down on a lot of unnecessary yaml entries.
if (layerData.RsiPath == null
&& layerData.TexturePath == null
&& sprite[index].Rsi == null
&& TryComp(held, out SpriteComponent? clothingSprite))
&& sprite[index].Rsi == null)
{
if (TryComp<ItemComponent>(held, out var itemComponent) && itemComponent.RsiPath != null)
sprite.LayerSetRSI(index, itemComponent.RsiPath);
else if (TryComp(held, out SpriteComponent? clothingSprite))
sprite.LayerSetRSI(index, clothingSprite.BaseRSI);
}