Makes magboots grant gravity. (#6054)
This commit is contained in:
parent
e306131841
commit
bd359dd54c
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue