Remove IMoveSpeedModifier in favor of events (#5212)
* Remove IMoveSpeedModifier * fucking magboots * yope * rabiews
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.EntitySystems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -7,16 +9,19 @@ using Robust.Shared.Serialization;
|
||||
namespace Content.Shared.Clothing
|
||||
{
|
||||
[NetworkedComponent()]
|
||||
public abstract class SharedMagbootsComponent : Component, IMoveSpeedModifier
|
||||
public abstract class SharedMagbootsComponent : Component
|
||||
{
|
||||
public sealed override string Name => "Magboots";
|
||||
|
||||
public abstract bool On { get; set; }
|
||||
|
||||
|
||||
protected void OnChanged()
|
||||
{
|
||||
MovementSpeedModifierComponent.RefreshItemModifiers(Owner);
|
||||
// inventory system will automatically hook into the event raised by this and update accordingly
|
||||
if (Owner.TryGetContainer(out var container))
|
||||
{
|
||||
EntitySystem.Get<MovementSpeedModifierSystem>().RefreshMovementSpeedModifiers(container.Owner.Uid);
|
||||
}
|
||||
}
|
||||
|
||||
public float WalkSpeedModifier => On ? 0.85f : 1;
|
||||
|
||||
Reference in New Issue
Block a user