Fix inhands not displaying (#1517)

This commit is contained in:
DrSmugleaf
2020-07-28 11:53:36 +02:00
committed by GitHub
parent 1245823f6d
commit c57b1c2914
2 changed files with 4 additions and 3 deletions

View File

@@ -145,7 +145,7 @@ namespace Content.Client.GameObjects.Components.Items
if (!entity.TryGetComponent(out ItemComponent item)) return; if (!entity.TryGetComponent(out ItemComponent item)) return;
var maybeInHands = item.GetInHandStateInfo(name); var maybeInHands = item.GetInHandStateInfo(hand.Location);
if (!maybeInHands.HasValue) if (!maybeInHands.HasValue)
{ {

View File

@@ -40,15 +40,16 @@ namespace Content.Client.GameObjects.Components.Items
} }
} }
public (RSI rsi, RSI.StateId stateId)? GetInHandStateInfo(string hand) public (RSI rsi, RSI.StateId stateId)? GetInHandStateInfo(HandLocation hand)
{ {
if (RsiPath == null) if (RsiPath == null)
{ {
return null; return null;
} }
var handName = hand.ToString().ToLowerInvariant();
var rsi = GetRSI(); var rsi = GetRSI();
var stateId = EquippedPrefix != null ? $"{EquippedPrefix}-inhand-{hand}" : $"inhand-{hand}"; var stateId = EquippedPrefix != null ? $"{EquippedPrefix}-inhand-{handName}" : $"inhand-{handName}";
if (rsi.TryGetState(stateId, out _)) if (rsi.TryGetState(stateId, out _))
{ {
return (rsi, stateId); return (rsi, stateId);