Fix weightlessness status effect appearing only after something checks if an entity is weightless (#2434)

* Revert "Add weightlessness status effect. (#2384)"

This reverts commit 9b751fc079.

* Bring back the icon and status

* Make weightless status track gravity and parent
This commit is contained in:
DrSmugleaf
2020-10-30 01:07:51 +01:00
committed by GitHub
parent bc4eab53df
commit ac3e9bc566
7 changed files with 168 additions and 69 deletions

View File

@@ -2,8 +2,8 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Atmos;
using Content.Server.GameObjects.Components.Buckle;
using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Pulling;
using Content.Shared.GameObjects.EntitySystems;
@@ -23,6 +23,20 @@ namespace Content.Server.GameObjects.Components.Mobs
[ViewVariables]
private readonly Dictionary<StatusEffect, StatusEffectStatus> _statusEffects = new Dictionary<StatusEffect, StatusEffectStatus>();
protected override void Startup()
{
base.Startup();
EntitySystem.Get<WeightlessSystem>().AddStatus(this);
}
public override void OnRemove()
{
EntitySystem.Get<WeightlessSystem>().RemoveStatus(this);
base.OnRemove();
}
public override ComponentState GetComponentState()
{
return new StatusEffectComponentState(_statusEffects);