Jetpacks (#9023)
* 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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user