Remove server/client clothing components. (#11981)

This commit is contained in:
Leon Friedrich
2022-10-23 11:30:37 +13:00
committed by GitHub
parent 4a3df4f85a
commit 7d276d1101
29 changed files with 110 additions and 131 deletions

View File

@@ -1,24 +1,22 @@
using Content.Server.Humanoid;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Humanoid;
using Content.Shared.Inventory.Events;
using Content.Shared.Tag;
namespace Content.Server.Clothing;
public sealed class ServerClothingSystem : EntitySystem
public sealed class ServerClothingSystem : ClothingSystem
{
[Dependency] private readonly HumanoidSystem _humanoidSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
public override void Initialize()
protected override void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
{
SubscribeLocalEvent<SharedClothingComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<SharedClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
}
base.OnGotEquipped(uid, component, args);
// why the fuck is humanoid visuals server-only???
private void OnGotEquipped(EntityUid uid, SharedClothingComponent component, GotEquippedEvent args)
{
if (args.Slot == "head"
&& _tagSystem.HasTag(args.Equipment, "HidesHair"))
{
@@ -27,8 +25,12 @@ public sealed class ServerClothingSystem : EntitySystem
}
}
private void OnGotUnequipped(EntityUid uid, SharedClothingComponent component, GotUnequippedEvent args)
protected override void OnGotUnequipped(EntityUid uid, ClothingComponent component, GotUnequippedEvent args)
{
base.OnGotUnequipped(uid, component, args);
// why the fuck is humanoid visuals server-only???
if (args.Slot == "head"
&& _tagSystem.HasTag(args.Equipment, "HidesHair"))
{