From: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:38:09 +0000 (+0200) Subject: place stored changeling identities next to each other (#39452) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9b5d2ff11b8f19fafbf97d6ceab238028ca6dfeb;p=space-station-14.git place stored changeling identities next to each other (#39452) --- diff --git a/Content.Shared/Changeling/ChangelingIdentitySystem.cs b/Content.Shared/Changeling/ChangelingIdentitySystem.cs index 8f704c49be..5e1fa25e4c 100644 --- a/Content.Shared/Changeling/ChangelingIdentitySystem.cs +++ b/Content.Shared/Changeling/ChangelingIdentitySystem.cs @@ -23,6 +23,7 @@ public sealed class ChangelingIdentitySystem : EntitySystem [Dependency] private readonly SharedPvsOverrideSystem _pvsOverrideSystem = default!; public MapId? PausedMapId; + private int _numberOfStoredIdentities = 0; // TODO: remove this public override void Initialize() { @@ -101,7 +102,11 @@ public sealed class ChangelingIdentitySystem : EntitySystem return null; EnsurePausedMap(); - var mob = Spawn(speciesPrototype.Prototype, new MapCoordinates(Vector2.Zero, PausedMapId!.Value)); + // TODO: Setting the spawn location is a shitty bandaid to prevent admins from crashing our servers. + // Movercontrollers and mob collisions are currently being calculated even for paused entities. + // Spawning all of them in the same spot causes severe performance problems. + // Cryopods and Polymorph have the same problem. + var mob = Spawn(speciesPrototype.Prototype, new MapCoordinates(new Vector2(2 * _numberOfStoredIdentities++, 0), PausedMapId!.Value)); var storedIdentity = EnsureComp(mob); storedIdentity.OriginalEntity = target; // TODO: network this once we have WeakEntityReference or the autonetworking source gen is fixed