Mirror speed penalty for worn duffels and hardsuits when in-hand (#22168)
* Add speed penalty for holding hardsuits and duffels * just inherit from ClothingSpeedModifier * comment godo
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Movement.Systems;
|
||||
|
||||
namespace Content.Shared.Hands.EntitySystems;
|
||||
|
||||
public abstract partial class SharedHandsSystem
|
||||
{
|
||||
private void InitializeRelay()
|
||||
{
|
||||
SubscribeLocalEvent<HandsComponent, RefreshMovementSpeedModifiersEvent>(RelayEvent);
|
||||
}
|
||||
|
||||
private void RelayEvent<T>(Entity<HandsComponent> entity, ref T args) where T : EntityEventArgs
|
||||
{
|
||||
var ev = new HeldRelayedEvent<T>(args);
|
||||
foreach (var held in EnumerateHeld(entity, entity.Comp))
|
||||
{
|
||||
RaiseLocalEvent(held, ref ev);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user