mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-19 06:28:40 +03:00
* add: Flip on hit system
* WD EDIT
* fix: animation
* fix: sound
* fix: sound
* Revert "fix: sound"
This reverts commit 64a12861ce.
* fix: sound
21 lines
625 B
C#
21 lines
625 B
C#
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;
|
|
}
|
|
}
|