Fix throwing in space.

This commit is contained in:
Pieter-Jan Briers
2020-07-08 18:28:59 +02:00
parent e815de7563
commit 023fd60054
6 changed files with 17 additions and 3 deletions

View File

@@ -10,6 +10,7 @@ namespace Content.Client.GameObjects.Components.Clothing
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(ItemComponent))] [ComponentReference(typeof(ItemComponent))]
[ComponentReference(typeof(IItemComponent))]
public class ClothingComponent : ItemComponent public class ClothingComponent : ItemComponent
{ {
private FemaleClothingMask _femaleMask; private FemaleClothingMask _femaleMask;

View File

@@ -17,7 +17,8 @@ using Robust.Shared.ViewVariables;
namespace Content.Client.GameObjects namespace Content.Client.GameObjects
{ {
[RegisterComponent] [RegisterComponent]
public class ItemComponent : Component [ComponentReference(typeof(IItemComponent))]
public class ItemComponent : Component, IItemComponent
{ {
public override string Name => "Item"; public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM; public override uint? NetID => ContentNetIDs.ITEM;

View File

@@ -18,6 +18,7 @@ namespace Content.Server.GameObjects
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(ItemComponent))] [ComponentReference(typeof(ItemComponent))]
[ComponentReference(typeof(StoreableComponent))] [ComponentReference(typeof(StoreableComponent))]
[ComponentReference(typeof(IItemComponent))]
public class ClothingComponent : ItemComponent, IUse public class ClothingComponent : ItemComponent, IUse
{ {
#pragma warning disable 649 #pragma warning disable 649

View File

@@ -25,7 +25,8 @@ namespace Content.Server.GameObjects
{ {
[RegisterComponent] [RegisterComponent]
[ComponentReference(typeof(StoreableComponent))] [ComponentReference(typeof(StoreableComponent))]
public class ItemComponent : StoreableComponent, IInteractHand, IExAct, IEquipped, IUnequipped [ComponentReference(typeof(IItemComponent))]
public class ItemComponent : StoreableComponent, IInteractHand, IExAct, IEquipped, IUnequipped, IItemComponent
{ {
public override string Name => "Item"; public override string Name => "Item";
public override uint? NetID => ContentNetIDs.ITEM; public override uint? NetID => ContentNetIDs.ITEM;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.Components.Items
{
public interface IItemComponent : IComponent
{
}
}

View File

@@ -1,5 +1,6 @@
#nullable enable #nullable enable
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Content.Shared.GameObjects.Components.Items;
using Content.Shared.GameObjects.Components.Movement; using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Physics; using Content.Shared.Physics;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
@@ -129,7 +130,7 @@ namespace Content.Shared.GameObjects.EntitySystems
// TODO: Item check. // TODO: Item check.
var touching = ((collider.CollisionMask & otherCollider.CollisionLayer) != 0x0 var touching = ((collider.CollisionMask & otherCollider.CollisionLayer) != 0x0
|| (otherCollider.CollisionMask & collider.CollisionLayer) != 0x0) // Ensure collision || (otherCollider.CollisionMask & collider.CollisionLayer) != 0x0) // Ensure collision
&& true; // !entity.HasComponent<ItemComponent>(); // This can't be an item && !entity.HasComponent<IItemComponent>(); // This can't be an item
if (touching) if (touching)
{ {