Turn off gravity on remove (#8446)

This commit is contained in:
wrexbe
2022-05-25 13:17:56 -07:00
committed by GitHub
parent ba3653c218
commit efedb3d7ba
2 changed files with 13 additions and 0 deletions

View File

@@ -20,11 +20,18 @@ namespace Content.Server.Gravity.EntitySystems
base.Initialize();
SubscribeLocalEvent<GravityGeneratorComponent, ComponentInit>(OnComponentInitialized);
SubscribeLocalEvent<GravityGeneratorComponent, ComponentShutdown>(OnComponentShutdown);
SubscribeLocalEvent<GravityGeneratorComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<GravityGeneratorComponent, SharedGravityGeneratorComponent.SwitchGeneratorMessage>(
OnSwitchGenerator);
}
private void OnComponentShutdown(EntityUid uid, GravityGeneratorComponent component, ComponentShutdown args)
{
component.GravityActive = false;
UpdateGravityActive(component, true);
}
public override void Update(float frameTime)
{
base.Update(frameTime);