Remove IMoveSpeedModifier in favor of events (#5212)

* Remove IMoveSpeedModifier

* fucking magboots

* yope

* rabiews
This commit is contained in:
mirrorcult
2021-11-07 22:17:35 -07:00
committed by GitHub
parent 3612d25539
commit 2d3077f560
26 changed files with 236 additions and 277 deletions

View File

@@ -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>();