Remove IMoveSpeedModifier in favor of events (#5212)
* Remove IMoveSpeedModifier * fucking magboots * yope * rabiews
This commit is contained in:
@@ -2,6 +2,7 @@ using Content.Client.HUD;
|
||||
using Content.Client.Items.Components;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.EntitySystems;
|
||||
using Content.Shared.Slippery;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
@@ -29,6 +30,7 @@ namespace Content.Client.Inventory
|
||||
SubscribeLocalEvent<ClientInventoryComponent, PlayerDetachedEvent>((_, component, _) => component.PlayerDetached());
|
||||
|
||||
SubscribeLocalEvent<ClientInventoryComponent, SlipAttemptEvent>(OnSlipAttemptEvent);
|
||||
SubscribeLocalEvent<ClientInventoryComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovespeed);
|
||||
}
|
||||
|
||||
// jesus christ, this is duplicated to server/client, should really just be shared..
|
||||
@@ -40,6 +42,17 @@ namespace Content.Client.Inventory
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRefreshMovespeed(EntityUid uid, ClientInventoryComponent component, RefreshMovementSpeedModifiersEvent args)
|
||||
{
|
||||
foreach (var (_, ent) in component.AllSlots)
|
||||
{
|
||||
if (ent != null)
|
||||
{
|
||||
RaiseLocalEvent(ent.Uid, args, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
CommandBinds.Unregister<ClientInventorySystem>();
|
||||
|
||||
Reference in New Issue
Block a user