Makes magboots grant gravity. (#6054)
This commit is contained in:
@@ -4,6 +4,7 @@ using Robust.Shared.GameObjects;
|
|||||||
namespace Content.Client.Clothing
|
namespace Content.Client.Clothing
|
||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
|
[ComponentReference(typeof(SharedMagbootsComponent))]
|
||||||
public sealed class MagbootsComponent : SharedMagbootsComponent
|
public sealed class MagbootsComponent : SharedMagbootsComponent
|
||||||
{
|
{
|
||||||
public override bool On { get; set; }
|
public override bool On { get; set; }
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ namespace Content.Server.Clothing.Components
|
|||||||
{
|
{
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
[ComponentReference(typeof(IActivate))]
|
[ComponentReference(typeof(IActivate))]
|
||||||
|
[ComponentReference(typeof(SharedMagbootsComponent))]
|
||||||
public sealed class MagbootsComponent : SharedMagbootsComponent, IActivate
|
public sealed class MagbootsComponent : SharedMagbootsComponent, IActivate
|
||||||
{
|
{
|
||||||
[ComponentDependency] private SharedItemComponent? _item = null;
|
[ComponentDependency] private SharedItemComponent? _item = null;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
|
using Content.Shared.Clothing;
|
||||||
using Content.Shared.Gravity;
|
using Content.Shared.Gravity;
|
||||||
|
using Content.Shared.Inventory;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
@@ -36,6 +38,13 @@ namespace Content.Shared.Movement.Components
|
|||||||
|
|
||||||
mapManager ??= IoCManager.Resolve<IMapManager>();
|
mapManager ??= IoCManager.Resolve<IMapManager>();
|
||||||
var grid = mapManager.GetGrid(gridId);
|
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)
|
if (!entityManager.GetComponent<GravityComponent>(grid.GridEntityId).Enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user