Faction Fixes

This commit is contained in:
NullWanderer 2024-03-24 00:31:49 +01:00
parent a31fc4df45
commit 20358fcdb7
No known key found for this signature in database
GPG Key ID: 65CF92BD1D26F4AC
3 changed files with 12 additions and 12 deletions

View File

@ -1,11 +1,12 @@
using Content.Shared.NPC.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
namespace Content.Server.NPC.Components
namespace Content.Shared.NPC.Components
{
[RegisterComponent]
/// <summary>
/// Allows clothing to add a faction to you when you wear it.
/// </summary>
[RegisterComponent]
public sealed partial class ClothingAddFactionComponent : Component
{
public bool IsActive = false;

View File

@ -1,6 +1,6 @@
using Content.Server.NPC.Components;
using Content.Shared.NPC.Components;
namespace Content.Server.NPC.Systems;
namespace Content.Shared.NPC.Systems;
public partial class NpcFactionSystem : EntitySystem
{

View File

@ -1,15 +1,14 @@
using Content.Server.NPC.Components;
using Content.Server.Store.Systems;
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory.Events;
using Content.Shared.NPC.Components;
namespace Content.Server.NPC.Systems;
namespace Content.Shared.NPC.Systems;
public partial class NpcFactionSystem : EntitySystem
{
public void InitializeItems()
{
SubscribeLocalEvent<NpcFactionMemberComponent, ItemPurchasedEvent>(OnItemPurchased);
// SubscribeLocalEvent<NpcFactionMemberComponent, ItemPurchasedEvent>(OnItemPurchased);
SubscribeLocalEvent<ClothingAddFactionComponent, GotEquippedEvent>(OnClothingEquipped);
SubscribeLocalEvent<ClothingAddFactionComponent, GotUnequippedEvent>(OnClothingUnequipped);
@ -19,10 +18,10 @@ public partial class NpcFactionSystem : EntitySystem
/// If we bought something we probably don't want it to start biting us after it's automatically placed in our hands.
/// If you do, consider finding a better solution to grenade penguin CBT.
/// </summary>
private void OnItemPurchased(EntityUid uid, NpcFactionMemberComponent component, ref ItemPurchasedEvent args)
{
component.ExceptionalFriendlies.Add(args.Purchaser);
}
// private void OnItemPurchased(EntityUid uid, NpcFactionMemberComponent component, ref ItemPurchasedEvent args)
// {
// component.ExceptionalFriendlies.Add(args.Purchaser);
// }
private void OnClothingEquipped(EntityUid uid, ClothingAddFactionComponent component, GotEquippedEvent args)
{