Resolves that make you flinch (#2423)

* argh

* ouch

* zap

* adds default!

* adressed review
This commit is contained in:
Paul Ritter
2020-10-30 01:13:35 +01:00
committed by GitHub
parent 12d8737e09
commit 1b3cbd4d3a
3 changed files with 38 additions and 32 deletions

View File

@@ -21,6 +21,8 @@ namespace Content.Client.GameObjects.Components.Items
[ComponentReference(typeof(IItemComponent))]
public class ItemComponent : Component, IItemComponent, IDraggable
{
[Dependency] private IResourceCache _resourceCache = default!;
public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM;
@@ -72,8 +74,7 @@ namespace Content.Client.GameObjects.Components.Items
protected RSI GetRSI()
{
var resourceCache = IoCManager.Resolve<IResourceCache>();
return resourceCache.GetResource<RSIResource>(SharedSpriteComponent.TextureRoot / RsiPath).RSI;
return _resourceCache.GetResource<RSIResource>(SharedSpriteComponent.TextureRoot / RsiPath).RSI;
}
public override void HandleComponentState(ComponentState curState, ComponentState nextState)