From 68e5b6924d8cdba5ce10e9591055c2f3878f2696 Mon Sep 17 00:00:00 2001
From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Date: Fri, 19 Apr 2024 15:16:17 +1200
Subject: [PATCH] Add ComponentRegistry overrides to more entity spawn methods
(#5051)
---
.../GameObjects/EntityManager.Spawn.cs | 4 ++--
.../GameObjects/EntitySystem.Proxy.cs | 18 +++++++++---------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/Robust.Shared/GameObjects/EntityManager.Spawn.cs b/Robust.Shared/GameObjects/EntityManager.Spawn.cs
index 20d2a74363b..ca96a731661 100644
--- a/Robust.Shared/GameObjects/EntityManager.Spawn.cs
+++ b/Robust.Shared/GameObjects/EntityManager.Spawn.cs
@@ -11,11 +11,11 @@ namespace Robust.Shared.GameObjects;
public partial class EntityManager
{
- // This method will soon be marked as obsolete.
+ // This method will soon(TM) be marked as obsolete.
public EntityUid SpawnEntity(string? protoName, EntityCoordinates coordinates, ComponentRegistry? overrides = null)
=> SpawnAttachedTo(protoName, coordinates, overrides);
- // This method will soon be marked as obsolete.
+ // This method will soon(TM) be marked as obsolete.
public EntityUid SpawnEntity(string? protoName, MapCoordinates coordinates, ComponentRegistry? overrides = null)
=> Spawn(protoName, coordinates, overrides);
diff --git a/Robust.Shared/GameObjects/EntitySystem.Proxy.cs b/Robust.Shared/GameObjects/EntitySystem.Proxy.cs
index 9c4266dc03c..c70bb05a362 100644
--- a/Robust.Shared/GameObjects/EntitySystem.Proxy.cs
+++ b/Robust.Shared/GameObjects/EntitySystem.Proxy.cs
@@ -701,32 +701,32 @@ protected void QueueDel(EntityUid? uid)
#region Entity Spawning
- // This method will be obsoleted soon.
+ // This method will be obsoleted soon(TM).
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected EntityUid Spawn(string? prototype, EntityCoordinates coordinates)
{
return ((IEntityManager)EntityManager).SpawnEntity(prototype, coordinates);
}
- ///
+ ///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- protected EntityUid Spawn(string? prototype, MapCoordinates coordinates, Angle rotation = default!)
- => EntityManager.Spawn(prototype, coordinates, rotation: rotation);
+ protected EntityUid Spawn(string? prototype, MapCoordinates coordinates, ComponentRegistry? overrides = null, Angle rotation = default)
+ => EntityManager.Spawn(prototype, coordinates, overrides, rotation);
- ///
+ ///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected EntityUid Spawn(string? prototype = null, ComponentRegistry? overrides = null, bool doMapInit = true)
=> EntityManager.Spawn(prototype, overrides, doMapInit);
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- protected EntityUid SpawnAttachedTo(string? prototype, EntityCoordinates coordinates)
- => EntityManager.SpawnAttachedTo(prototype, coordinates);
+ protected EntityUid SpawnAttachedTo(string? prototype, EntityCoordinates coordinates, ComponentRegistry? overrides = null)
+ => EntityManager.SpawnAttachedTo(prototype, coordinates, overrides);
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- protected EntityUid SpawnAtPosition(string? prototype, EntityCoordinates coordinates)
- => EntityManager.SpawnAtPosition(prototype, coordinates);
+ protected EntityUid SpawnAtPosition(string? prototype, EntityCoordinates coordinates, ComponentRegistry? overrides = null)
+ => EntityManager.SpawnAtPosition(prototype, coordinates, overrides);
///
[MethodImpl(MethodImplOptions.AggressiveInlining)]