Entities now require a location when being spawned.

This commit is contained in:
Acruid
2019-12-16 21:44:24 -08:00
parent 12261c5b56
commit 1fe09c580c
17 changed files with 27 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Sound;
using Content.Server.GameObjects.EntitySystems;
@@ -162,7 +162,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (_finishPrototype != null)
{
var finisher = Owner.EntityManager.SpawnEntity(_finishPrototype);
var finisher = Owner.EntityManager.SpawnEntity(_finishPrototype, Owner.Transform.GridPosition);
if (user.TryGetComponent(out HandsComponent handsComponent) && finisher.TryGetComponent(out ItemComponent itemComponent))
{
if (handsComponent.CanPutInHand(itemComponent))

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Sound;
@@ -148,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (_availableSpawnCount > 0)
{
var prototypeName = _getProbItem(_prototypes);
item = Owner.EntityManager.SpawnEntity(prototypeName);
item = Owner.EntityManager.SpawnEntity(prototypeName, Owner.Transform.GridPosition);
_availableSpawnCount -= 1;
}
@@ -166,7 +166,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
// Ideally this takes priority to be put into inventory rather than the desired item
if (_finishPrototype != null)
{
var item = Owner.EntityManager.SpawnEntity(_finishPrototype);
var item = Owner.EntityManager.SpawnEntity(_finishPrototype, Owner.Transform.GridPosition);
item.Transform.GridPosition = Owner.Transform.GridPosition;
Owner.Delete();
if (user.TryGetComponent(out HandsComponent handsComponent) &&

View File

@@ -160,7 +160,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (_finishPrototype != null)
{
var finisher = Owner.EntityManager.SpawnEntity(_finishPrototype);
var finisher = Owner.EntityManager.SpawnEntity(_finishPrototype, Owner.Transform.GridPosition);
if (user.TryGetComponent(out HandsComponent handsComponent) && finisher.TryGetComponent(out ItemComponent itemComponent))
{
if (handsComponent.CanPutInHand(itemComponent))