* Movement acceleration * tweaks * Weightless refactor coz fuck it * CCVars * weightless movement tweaks * Some cleanup while I'm here * dorkpacks * thanks fork * fixes * zoomies * toggles * hmm * yamls * b * so true * Effects refactor * namespace * review
27 lines
897 B
C#
27 lines
897 B
C#
using Content.Shared.Movement.Components;
|
|
using Robust.Shared.GameStates;
|
|
|
|
namespace Content.Shared.Movement.Systems;
|
|
|
|
public sealed class MovementIgnoreGravitySystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
SubscribeLocalEvent<MovementIgnoreGravityComponent, ComponentGetState>(GetState);
|
|
SubscribeLocalEvent<MovementIgnoreGravityComponent, ComponentHandleState>(HandleState);
|
|
}
|
|
|
|
private void HandleState(EntityUid uid, MovementIgnoreGravityComponent component, ref ComponentHandleState args)
|
|
{
|
|
if (args.Next is null)
|
|
return;
|
|
|
|
component.Weightless = ((MovementIgnoreGravityComponentState) args.Next).Weightless;
|
|
}
|
|
|
|
private void GetState(EntityUid uid, MovementIgnoreGravityComponent component, ref ComponentGetState args)
|
|
{
|
|
args.State = new MovementIgnoreGravityComponentState(component);
|
|
}
|
|
}
|