Fixes ShowHandItemOverlay freezing the game when the item in question has no sprite component.

This commit is contained in:
Vera Aguilera Puerto
2021-10-22 13:44:37 +02:00
parent 86607e4fd6
commit c4f6b71eb7
2 changed files with 6 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.CCVar;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
@@ -45,7 +46,7 @@ namespace Content.Client.Hands
var sys = EntitySystem.Get<HandsSystem>();
var handEntity = sys.GetActiveHandEntity();
if (handEntity == null || !_cfg.GetCVar(CCVars.HudHeldItemShow))
if (handEntity == null || !_cfg.GetCVar(CCVars.HudHeldItemShow) || !handEntity.HasComponent<ISpriteComponent>())
return;
var screen = args.ScreenHandle;

View File

@@ -0,0 +1,4 @@
author: Zumorica
changes:
- type: Fix # One of the following: Add, Remove, Tweak, Fix
message: Fixes pulling items with hand item cursor overlay freezing the game.