Fix desword wielding
This commit is contained in:
6
Content.Shared/White/Wield/ToggleableWieldedComponent.cs
Normal file
6
Content.Shared/White/Wield/ToggleableWieldedComponent.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
namespace Content.Shared.White.Wield;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class ToggleableWieldedComponent : Component
|
||||
{
|
||||
}
|
||||
20
Content.Shared/White/Wield/ToggleableWieldedSystem.cs
Normal file
20
Content.Shared/White/Wield/ToggleableWieldedSystem.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Item.ItemToggle.Components;
|
||||
using Content.Shared.Wieldable.Components;
|
||||
|
||||
namespace Content.Shared.White.Wield;
|
||||
|
||||
public sealed class ToggleableWieldedSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ToggleableWieldedComponent, ItemToggleActivateAttemptEvent>(AttemptActivate);
|
||||
}
|
||||
|
||||
private void AttemptActivate(Entity<ToggleableWieldedComponent> ent, ref ItemToggleActivateAttemptEvent args)
|
||||
{
|
||||
if (TryComp(ent, out WieldableComponent? wieldable) && !wieldable.Wielded)
|
||||
args.Cancelled = true;
|
||||
}
|
||||
}
|
||||
@@ -267,6 +267,7 @@
|
||||
enabled: false
|
||||
reflects:
|
||||
- Energy
|
||||
- type: ToggleableWielded
|
||||
- type: Construction
|
||||
deconstructionTarget: null
|
||||
graph: EnergyDoubleSwordGraph
|
||||
|
||||
Reference in New Issue
Block a user