Actual lockers (#195)

Adds storing entities into lockers the way we all know and love.
Relies on an implementation of ITileDefinition in https://github.com/space-wizards/space-station-14/pull/193 (just like origin/master)
#191
This commit is contained in:
PrPleGoo
2019-04-17 23:26:00 +02:00
committed by Pieter-Jan Briers
parent 1fe24eeb12
commit 903961771b
19 changed files with 272 additions and 41 deletions

View File

@@ -109,22 +109,16 @@ namespace Content.Server.GameObjects.EntitySystems
{
var ent = ((IPlayerSession) session).AttachedEntity;
if(ent == null || !ent.IsValid())
if (ent == null || !ent.IsValid())
{
return;
}
if (!ent.TryGetComponent(out HandsComponent handsComp))
{
return;
var transform = ent.Transform;
if (transform.GridPosition.InRange(coords, InteractionSystem.INTERACTION_RANGE))
{
handsComp.Drop(handsComp.ActiveIndex, coords);
}
else
{
handsComp.Drop(handsComp.ActiveIndex);
}
handsComp.Drop(handsComp.ActiveIndex);
}
private static void HandleActivateItem(ICommonSession session)
@@ -163,22 +157,17 @@ namespace Content.Server.GameObjects.EntitySystems
if (!throwEnt.TryGetComponent(out CollidableComponent colComp))
{
colComp = throwEnt.AddComponent<CollidableComponent>();
if(!colComp.Running)
colComp.Startup();
return;
}
colComp.CollisionEnabled = true;
colComp.CollisionLayer |= (int)CollisionGroup.Items;
colComp.CollisionMask |= (int)CollisionGroup.Grid;
// I can now collide with player, so that i can do damage.
colComp.CollisionMask |= (int) CollisionGroup.Mob;
if (!throwEnt.TryGetComponent(out ThrownItemComponent projComp))
{
projComp = throwEnt.AddComponent<ThrownItemComponent>();
colComp.CollisionMask |= (int)CollisionGroup.Mob;
colComp.IsScrapingFloor = false;
}
projComp.IgnoreEntity(plyEnt);