Entities now require a location when being spawned.
This commit is contained in:
@@ -252,7 +252,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
{
|
||||
return;
|
||||
}
|
||||
var cell = Owner.EntityManager.SpawnEntity("PowerCellSmallHyper");
|
||||
var cell = Owner.EntityManager.SpawnEntity("PowerCellSmallHyper", Owner.Transform.GridPosition);
|
||||
_cellContainer.Insert(cell);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,7 @@ namespace Content.Server.GameObjects.Components.Interactable.Tools
|
||||
mapGrid.SetTile(eventArgs.ClickLocation, new Tile(underplating.TileId));
|
||||
_entitySystemManager.GetEntitySystem<AudioSystem>().Play("/Audio/items/crowbar.ogg", Owner);
|
||||
//Actually spawn the relevant tile item at the right position and give it some offset to the corner.
|
||||
var tileItem = Owner.EntityManager.SpawnEntity(tileDef.ItemDropPrototypeName);
|
||||
tileItem.Transform.GridPosition = coordinates;
|
||||
var tileItem = Owner.EntityManager.SpawnEntity(tileDef.ItemDropPrototypeName, coordinates);
|
||||
tileItem.Transform.WorldPosition += (0.2f, 0.2f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
|
||||
void Spawn(string prototype)
|
||||
{
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype));
|
||||
storage.Insert(_entityManager.SpawnEntityAt(prototype, Owner.Transform.GridPosition));
|
||||
}
|
||||
|
||||
Spawn("Brutepack");
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
|
||||
void Spawn(string prototype)
|
||||
{
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype));
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.GridPosition));
|
||||
}
|
||||
|
||||
if (random.Prob(0.4f))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Random;
|
||||
@@ -23,7 +23,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
|
||||
void Spawn(string prototype)
|
||||
{
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype));
|
||||
storage.Insert(_entityManager.SpawnEntityAt(prototype, Owner.Transform.GridPosition));
|
||||
}
|
||||
|
||||
Spawn("Screwdriver");
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
|
||||
|
||||
void Spawn(string prototype)
|
||||
{
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype));
|
||||
storage.Insert(_entityManager.SpawnEntity(prototype, Owner.Transform.GridPosition));
|
||||
}
|
||||
|
||||
Spawn("Crowbar");
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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) &&
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -202,10 +202,10 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
switch (BulbType)
|
||||
{
|
||||
case LightBulbType.Tube:
|
||||
_lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightTube"));
|
||||
_lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightTube", Owner.Transform.GridPosition));
|
||||
break;
|
||||
case LightBulbType.Bulb:
|
||||
_lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightBulb"));
|
||||
_lightBulbContainer.Insert(Owner.EntityManager.SpawnEntity("LightBulb", Owner.Transform.GridPosition));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
}
|
||||
|
||||
_availableSpawnCount -= 1;
|
||||
bullet = Owner.EntityManager.SpawnEntity(FillType);
|
||||
bullet = Owner.EntityManager.SpawnEntity(FillType, Owner.Transform.GridPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
}
|
||||
|
||||
_availableSpawnCount -= 1;
|
||||
bullet = Owner.EntityManager.SpawnEntity(FillType);
|
||||
bullet = Owner.EntityManager.SpawnEntity(FillType, Owner.Transform.GridPosition);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
{
|
||||
if (_defaultMagazine != null)
|
||||
{
|
||||
var magazine = Owner.EntityManager.SpawnEntity(_defaultMagazine);
|
||||
var magazine = Owner.EntityManager.SpawnEntity(_defaultMagazine, Owner.Transform.GridPosition);
|
||||
InsertMagazine(magazine, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Content.Server.GameObjects.Components.Sound;
|
||||
using Robust.Server.GameObjects.Components.Container;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -78,7 +78,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
return null;
|
||||
}
|
||||
|
||||
var projectile = Owner.EntityManager.SpawnEntity(bullet.ProjectileType);
|
||||
var projectile = Owner.EntityManager.SpawnEntity(bullet.ProjectileType, Owner.Transform.GridPosition);
|
||||
bullet.Spent = true;
|
||||
|
||||
CycleChamberedBullet(0);
|
||||
|
||||
Reference in New Issue
Block a user