From 558f6ab8a51f0f895041f78581e9a4178174fda1 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sun, 7 Jul 2019 22:24:44 +0200 Subject: [PATCH] Removal of TrySpawn* methods, update submodule. --- .../Components/Construction/ConstructorComponent.cs | 2 +- Content.Server/Administration/AGhost.cs | 2 +- .../Components/Construction/ConstructionComponent.cs | 2 +- .../Components/Construction/ConstructorComponent.cs | 4 ++-- .../GameObjects/Components/Damage/DestructibleComponent.cs | 2 +- .../GameObjects/Components/Research/LatheComponent.cs | 2 +- Content.Server/GameObjects/EntitySystems/HandsSystem.cs | 2 +- Content.Server/GameTicking/GameTicker.cs | 4 ++-- RobustToolbox | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index 00c3870cef..b2243449b8 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -63,7 +63,7 @@ namespace Content.Client.GameObjects.Components.Construction public void SpawnGhost(ConstructionPrototype prototype, GridCoordinates loc, Direction dir) { var entMgr = IoCManager.Resolve(); - var ghost = entMgr.ForceSpawnEntityAt("constructionghost", loc); + var ghost = entMgr.SpawnEntityAt("constructionghost", loc); var comp = ghost.GetComponent(); comp.Prototype = prototype; comp.Master = this; diff --git a/Content.Server/Administration/AGhost.cs b/Content.Server/Administration/AGhost.cs index 31abc066d3..b6d8055d1e 100644 --- a/Content.Server/Administration/AGhost.cs +++ b/Content.Server/Administration/AGhost.cs @@ -30,7 +30,7 @@ namespace Content.Server.Administration else { var entityManager = IoCManager.Resolve(); - var ghost = entityManager.ForceSpawnEntityAt("AdminObserver", + var ghost = entityManager.SpawnEntityAt("AdminObserver", player.AttachedEntity.Transform.GridPosition); mind.Visit(ghost); diff --git a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs index c6e8d3f656..4e35820fd6 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructionComponent.cs @@ -51,7 +51,7 @@ namespace Content.Server.GameObjects.Components.Construction { // Oh boy we get to finish construction! var entMgr = IoCManager.Resolve(); - var ent = entMgr.ForceSpawnEntityAt(Prototype.Result, Transform.GridPosition); + var ent = entMgr.SpawnEntityAt(Prototype.Result, Transform.GridPosition); ent.GetComponent().LocalRotation = Transform.LocalRotation; Owner.Delete(); return true; diff --git a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs index 92562e246b..2c58b26c14 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs @@ -83,12 +83,12 @@ namespace Content.Server.GameObjects.Components.Construction if (prototype.Stages.Count == 2) { // Exactly 2 stages, so don't make an intermediate frame. - var ent = _serverEntityManager.ForceSpawnEntityAt(prototype.Result, loc); + var ent = _serverEntityManager.SpawnEntityAt(prototype.Result, loc); ent.Transform.LocalRotation = angle; } else { - var frame = _serverEntityManager.ForceSpawnEntityAt("structureconstructionframe", loc); + var frame = _serverEntityManager.SpawnEntityAt("structureconstructionframe", loc); var construction = frame.GetComponent(); construction.Init(prototype); frame.Transform.LocalRotation = angle; diff --git a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs index 62c9eb8ea8..daa1355754 100644 --- a/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs +++ b/Content.Server/GameObjects/Components/Damage/DestructibleComponent.cs @@ -96,7 +96,7 @@ namespace Content.Server.GameObjects.Components.Destructible { if (!string.IsNullOrWhiteSpace(spawnOnDestroy) && eventArgs.IsSpawnWreck) { - Owner.EntityManager.TrySpawnEntityAt(spawnOnDestroy, Owner.Transform.GridPosition, out var wreck); + Owner.EntityManager.SpawnEntityAt(spawnOnDestroy, Owner.Transform.GridPosition); } } } diff --git a/Content.Server/GameObjects/Components/Research/LatheComponent.cs b/Content.Server/GameObjects/Components/Research/LatheComponent.cs index dff3661d66..437a89fbd0 100644 --- a/Content.Server/GameObjects/Components/Research/LatheComponent.cs +++ b/Content.Server/GameObjects/Components/Research/LatheComponent.cs @@ -79,7 +79,7 @@ namespace Content.Server.GameObjects.Components.Research { Producing = false; _producingRecipe = null; - Owner.EntityManager.TrySpawnEntityAt(recipe.Result, Owner.Transform.GridPosition, out var entity); + Owner.EntityManager.SpawnEntityAt(recipe.Result, Owner.Transform.GridPosition); _userInterface.SendMessage(new LatheStoppedProducingRecipeMessage()); }); diff --git a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs index 60f4476322..035d0626ec 100644 --- a/Content.Server/GameObjects/EntitySystems/HandsSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/HandsSystem.cs @@ -143,7 +143,7 @@ namespace Content.Server.GameObjects.EntitySystems else { stackComp.Use(1); - throwEnt = throwEnt.EntityManager.ForceSpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition); + throwEnt = throwEnt.EntityManager.SpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition); } if (!throwEnt.TryGetComponent(out CollidableComponent colComp)) diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 520331945c..6ca3cc1cc0 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -261,7 +261,7 @@ namespace Content.Server.GameTicking private IEntity _spawnPlayerMob() { - var entity = _entityManager.ForceSpawnEntityAt(PlayerPrototypeName, _getLateJoinSpawnPoint()); + var entity = _entityManager.SpawnEntityAt(PlayerPrototypeName, _getLateJoinSpawnPoint()); var shoes = _entityManager.SpawnEntity("ShoesItem"); var uniform = _entityManager.SpawnEntity("UniformAssistant"); if (entity.TryGetComponent(out InventoryComponent inventory)) @@ -275,7 +275,7 @@ namespace Content.Server.GameTicking private IEntity _spawnObserverMob() { - return _entityManager.ForceSpawnEntityAt(ObserverPrototypeName, _getLateJoinSpawnPoint()); + return _entityManager.SpawnEntityAt(ObserverPrototypeName, _getLateJoinSpawnPoint()); } private GridCoordinates _getLateJoinSpawnPoint() diff --git a/RobustToolbox b/RobustToolbox index 78c393aac5..c9906b15d3 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 78c393aac54b30b2da34821a4da41487ea5ecc91 +Subproject commit c9906b15d38f99742a6529f9e443368e68261b21