Makes magboots grant gravity. (#6054)

This commit is contained in:
Moony
2022-01-13 06:13:25 -08:00
committed by GitHub
parent e306131841
commit bd359dd54c
3 changed files with 11 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ using Robust.Shared.GameObjects;
namespace Content.Client.Clothing
{
[RegisterComponent]
[ComponentReference(typeof(SharedMagbootsComponent))]
public sealed class MagbootsComponent : SharedMagbootsComponent
{
public override bool On { get; set; }

View File

@@ -17,6 +17,7 @@ namespace Content.Server.Clothing.Components
{
[RegisterComponent]
[ComponentReference(typeof(IActivate))]
[ComponentReference(typeof(SharedMagbootsComponent))]
public sealed class MagbootsComponent : SharedMagbootsComponent, IActivate
{
[ComponentDependency] private SharedItemComponent? _item = null;

View File

@@ -1,4 +1,6 @@
using Content.Shared.Clothing;
using Content.Shared.Gravity;
using Content.Shared.Inventory;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
@@ -36,6 +38,13 @@ namespace Content.Shared.Movement.Components
mapManager ??= IoCManager.Resolve<IMapManager>();
var grid = mapManager.GetGrid(gridId);
var invSys = EntitySystem.Get<InventorySystem>();
if (invSys.TryGetSlotEntity(entity, "shoes", out var ent))
{
if (entityManager.TryGetComponent<SharedMagbootsComponent>(ent, out var boots) && boots.On)
return false;
}
if (!entityManager.GetComponent<GravityComponent>(grid.GridEntityId).Enabled)
{