Clothing/item ECS & cleanup (#9706)

This commit is contained in:
Kara
2022-07-27 03:53:47 -07:00
committed by GitHub
parent 0f0420eca9
commit 258ec0cac1
164 changed files with 938 additions and 918 deletions

View File

@@ -22,6 +22,7 @@ namespace Content.Server.Wieldable
[Dependency] private readonly DoAfterSystem _doAfter = default!;
[Dependency] private readonly HandVirtualItemSystem _virtualItemSystem = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedItemSystem _itemSystem = default!;
public override void Initialize()
{
@@ -167,10 +168,10 @@ namespace Content.Server.Wieldable
if (!CanWield(uid, component, args.User.Value) || component.Wielded)
return;
if (TryComp<SharedItemComponent>(uid, out var item))
if (TryComp<ItemComponent>(uid, out var item))
{
component.OldInhandPrefix = item.EquippedPrefix;
item.EquippedPrefix = component.WieldedInhandPrefix;
component.OldInhandPrefix = item.HeldPrefix;
_itemSystem.SetHeldPrefix(uid, component.WieldedInhandPrefix, item);
}
component.Wielded = true;
@@ -196,9 +197,9 @@ namespace Content.Server.Wieldable
if (!component.Wielded)
return;
if (TryComp<SharedItemComponent>(uid, out var item))
if (TryComp<ItemComponent>(uid, out var item))
{
item.EquippedPrefix = component.OldInhandPrefix;
_itemSystem.SetHeldPrefix(uid, component.OldInhandPrefix, item);
}
component.Wielded = false;