Fix strippable showing virtual items.
This commit is contained in:
@@ -8,6 +8,7 @@ using Content.Server.Items;
|
|||||||
using Content.Server.UserInterface;
|
using Content.Server.UserInterface;
|
||||||
using Content.Shared.ActionBlocker;
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.DragDrop;
|
using Content.Shared.DragDrop;
|
||||||
|
using Content.Shared.Hands.Components;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using Content.Shared.Strip.Components;
|
using Content.Shared.Strip.Components;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
@@ -26,6 +27,8 @@ namespace Content.Server.Strip
|
|||||||
{
|
{
|
||||||
public const float StripDelay = 2f;
|
public const float StripDelay = 2f;
|
||||||
|
|
||||||
|
// TODO: This component needs localization.
|
||||||
|
|
||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private BoundUserInterface? UserInterface => Owner.GetUIOrNull(StrippingUiKey.Key);
|
private BoundUserInterface? UserInterface => Owner.GetUIOrNull(StrippingUiKey.Key);
|
||||||
|
|
||||||
@@ -128,7 +131,15 @@ namespace Content.Server.Strip
|
|||||||
|
|
||||||
foreach (var hand in hands.HandNames)
|
foreach (var hand in hands.HandNames)
|
||||||
{
|
{
|
||||||
dictionary[hand] = hands.GetItem(hand)?.Owner.Name ?? "None";
|
var owner = hands.GetItem(hand)?.Owner;
|
||||||
|
|
||||||
|
if (owner?.HasComponent<HandVirtualItemComponent>() ?? true)
|
||||||
|
{
|
||||||
|
dictionary[hand] = "None";
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dictionary[hand] = owner.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return dictionary;
|
return dictionary;
|
||||||
@@ -348,6 +359,9 @@ namespace Content.Server.Strip
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (heldItem.Owner.HasComponent<HandVirtualItemComponent>())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!hands.CanDrop(hand, false))
|
if (!hands.CanDrop(hand, false))
|
||||||
{
|
{
|
||||||
user.PopupMessageCursor(Loc.GetString("strippable-component-cannot-drop-message",("owner", Owner)));
|
user.PopupMessageCursor(Loc.GetString("strippable-component-cannot-drop-message",("owner", Owner)));
|
||||||
|
|||||||
4
Resources/Changelog/Parts/strip.yml
Normal file
4
Resources/Changelog/Parts/strip.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
author: Your_Name_Here
|
||||||
|
changes:
|
||||||
|
- type: Fix # One of the following: Add, Remove, Tweak, Fix
|
||||||
|
message: Fix mob inventory strip window showing virtual items it shouldn't.
|
||||||
Reference in New Issue
Block a user