API changes, renamed SpawnEntityAt to SpawnEntity.

This commit is contained in:
Acruid
2020-01-24 16:10:48 -08:00
parent 4ab7f1dcb3
commit a86363a6d2
20 changed files with 44 additions and 30 deletions

View File

@@ -4,8 +4,10 @@ using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power
@@ -140,7 +142,7 @@ namespace Content.Server.GameObjects.Components.Power
if (eventArgs.AttackWith.TryGetComponent(out WirecutterComponent wirecutter))
{
Owner.Delete();
var droppedEnt = Owner.EntityManager.SpawnEntityAt("CableStack", eventArgs.ClickLocation);
var droppedEnt = Owner.EntityManager.SpawnEntity("CableStack", eventArgs.ClickLocation);
if (droppedEnt.TryGetComponent<StackComponent>(out var stackComp))
stackComp.Count = 1;

View File

@@ -4,8 +4,10 @@ using Robust.Server.GameObjects;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.Transform;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.Components.Power
{
@@ -50,7 +52,8 @@ namespace Content.Server.GameObjects.Components.Power
if (Owner.TryGetComponent(out StackComponent stack) && !stack.Use(1))
return;
var newWire = _entityManager.SpawnEntityAt("Wire", grid.GridTileToLocal(snapPos));
GridCoordinates coordinates = grid.GridTileToLocal(snapPos);
var newWire = _entityManager.SpawnEntity("Wire", coordinates);
if (newWire.TryGetComponent(out SpriteComponent wireSpriteComp) && hasItemSpriteComp)
{
wireSpriteComp.Color = itemSpriteComp.Color;