diff --git a/Content.Client/ContextMenu/UI/EntityMenuPresenter.cs b/Content.Client/ContextMenu/UI/EntityMenuPresenter.cs index bead833a70..504b670778 100644 --- a/Content.Client/ContextMenu/UI/EntityMenuPresenter.cs +++ b/Content.Client/ContextMenu/UI/EntityMenuPresenter.cs @@ -18,6 +18,7 @@ using Robust.Shared.Input.Binding; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Maths; +using Robust.Shared.Prototypes; using Robust.Shared.Timing; namespace Content.Client.ContextMenu.UI { @@ -84,7 +85,7 @@ namespace Content.Client.ContextMenu.UI var entitySpriteStates = GroupEntities(entities); var orderedStates = entitySpriteStates.ToList(); - orderedStates.Sort((x, y) => string.CompareOrdinal(x.First().Prototype?.Name, y.First().Prototype?.Name)); + orderedStates.Sort((x, y) => string.CompareOrdinal(IoCManager.Resolve().GetComponent(x.First().Uid).EntityPrototype?.Name, IoCManager.Resolve().GetComponent(y.First().Uid).EntityPrototype?.Name)); Elements.Clear(); AddToUI(orderedStates); diff --git a/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs b/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs index ba958693bb..2a2b4688b4 100644 --- a/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs +++ b/Content.Client/ContextMenu/UI/EntityMenuPresenterGrouping.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Prototypes; namespace Content.Client.ContextMenu.UI { @@ -20,7 +22,7 @@ namespace Content.Client.ContextMenu.UI { if (GroupingContextMenuType == 0) { - var newEntities = entities.GroupBy(e => e.Name + (e.Prototype?.ID ?? string.Empty)).ToList(); + var newEntities = entities.GroupBy(e => e.Name + (IoCManager.Resolve().GetComponent(e.Uid).EntityPrototype?.ID ?? string.Empty)).ToList(); return newEntities.Select(grp => grp.ToList()).ToList(); } else @@ -34,7 +36,7 @@ namespace Content.Client.ContextMenu.UI { private static readonly List> EqualsList = new() { - (a, b) => a.Prototype!.ID == b.Prototype!.ID, + (a, b) => IoCManager.Resolve().GetComponent(a.Uid).EntityPrototype!.ID == IoCManager.Resolve().GetComponent(b.Uid).EntityPrototype!.ID, (a, b) => { a.TryGetComponent(out var spriteA); @@ -51,7 +53,7 @@ namespace Content.Client.ContextMenu.UI }; private static readonly List> GetHashCodeList = new() { - e => EqualityComparer.Default.GetHashCode(e.Prototype!.ID), + e => EqualityComparer.Default.GetHashCode(IoCManager.Resolve().GetComponent(e.Uid).EntityPrototype!.ID), e => { var hash = 0; diff --git a/Content.IntegrationTests/Tests/Destructible/DestructibleDestructionTest.cs b/Content.IntegrationTests/Tests/Destructible/DestructibleDestructionTest.cs index 27c40f87b0..663f6c8cf0 100644 --- a/Content.IntegrationTests/Tests/Destructible/DestructibleDestructionTest.cs +++ b/Content.IntegrationTests/Tests/Destructible/DestructibleDestructionTest.cs @@ -73,12 +73,12 @@ namespace Content.IntegrationTests.Tests.Destructible foreach (var entity in entitiesInRange) { - if (entity.Prototype == null) + if (IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype == null) { continue; } - if (entity.Prototype.Name != SpawnedEntityId) + if (IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype.Name != SpawnedEntityId) { continue; } diff --git a/Content.IntegrationTests/Tests/InventoryHelpersTest.cs b/Content.IntegrationTests/Tests/InventoryHelpersTest.cs index 51c489755f..275d24c002 100644 --- a/Content.IntegrationTests/Tests/InventoryHelpersTest.cs +++ b/Content.IntegrationTests/Tests/InventoryHelpersTest.cs @@ -8,6 +8,7 @@ using NUnit.Framework; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Prototypes; using static Content.Shared.Inventory.EquipmentSlotDefines; namespace Content.IntegrationTests.Tests @@ -71,7 +72,7 @@ namespace Content.IntegrationTests.Tests // Do we actually have the uniform equipped? Assert.That(inventory.TryGetSlotItem(Slots.INNERCLOTHING, out ItemComponent uniform)); - Assert.That(uniform.Owner.Prototype != null && uniform.Owner.Prototype.ID == "InventoryJumpsuitJanitorDummy"); + Assert.That(IoCManager.Resolve().GetComponent(uniform.Owner.Uid).EntityPrototype != null && IoCManager.Resolve().GetComponent(uniform.Owner.Uid).EntityPrototype.ID == "InventoryJumpsuitJanitorDummy"); EntitySystem.Get().TryStun(human.Uid, TimeSpan.FromSeconds(1f)); @@ -84,7 +85,7 @@ namespace Content.IntegrationTests.Tests // Let's try skipping the interaction check and see if it equips it! Assert.That(inventory.SpawnItemInSlot(Slots.IDCARD, "InventoryIDCardDummy")); Assert.That(inventory.TryGetSlotItem(Slots.IDCARD, out ItemComponent id)); - Assert.That(id.Owner.Prototype != null && id.Owner.Prototype.ID == "InventoryIDCardDummy"); + Assert.That(IoCManager.Resolve().GetComponent(id.Owner.Uid).EntityPrototype != null && IoCManager.Resolve().GetComponent(id.Owner.Uid).EntityPrototype.ID == "InventoryIDCardDummy"); }); await server.WaitIdleAsync(); diff --git a/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs b/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs index f646ce9281..0cc0eda009 100644 --- a/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs +++ b/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs @@ -3,6 +3,7 @@ using Robust.Shared.Console; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using System.Linq; +using Robust.Shared.Prototypes; namespace Content.Server.Administration.Commands { @@ -23,7 +24,7 @@ namespace Content.Server.Administration.Commands var id = args[0].ToLower(); var entityManager = IoCManager.Resolve(); - var entities = entityManager.GetEntities().Where(e => e.Prototype?.ID.ToLower() == id); + var entities = entityManager.GetEntities().Where(e => IoCManager.Resolve().GetComponent(e.Uid).EntityPrototype?.ID.ToLower() == id); var i = 0; foreach (var entity in entities) diff --git a/Content.Server/Administration/Commands/FindEntitiesWithComponents.cs b/Content.Server/Administration/Commands/FindEntitiesWithComponents.cs index b619159294..54d9cbb2f6 100644 --- a/Content.Server/Administration/Commands/FindEntitiesWithComponents.cs +++ b/Content.Server/Administration/Commands/FindEntitiesWithComponents.cs @@ -5,6 +5,7 @@ using Content.Shared.Administration; using Robust.Shared.Console; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Prototypes; namespace Content.Server.Administration.Commands { @@ -52,12 +53,12 @@ namespace Content.Server.Administration.Commands foreach (var entity in entitiesWithAllComponents) { - if (entity.Prototype == null) + if (IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype == null) { continue; } - entityIds.Add(entity.Prototype.ID); + entityIds.Add(IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype.ID); } if (entityIds.Count == 0) diff --git a/Content.Server/Administration/Commands/RemoveExtraComponents.cs b/Content.Server/Administration/Commands/RemoveExtraComponents.cs index b680ecac06..4d3d0200c2 100644 --- a/Content.Server/Administration/Commands/RemoveExtraComponents.cs +++ b/Content.Server/Administration/Commands/RemoveExtraComponents.cs @@ -32,7 +32,7 @@ namespace Content.Server.Administration.Commands foreach (var entity in entityManager.GetEntities()) { - if (checkPrototype && entity.Prototype != prototype || entity.Prototype == null) + if (checkPrototype && IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype != prototype || IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype == null) { continue; } @@ -41,7 +41,7 @@ namespace Content.Server.Administration.Commands foreach (var component in entity.GetAllComponents()) { - if (entity.Prototype.Components.ContainsKey(component.Name)) + if (IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype.Components.ContainsKey(component.Name)) continue; entityManager.RemoveComponent(entity.Uid, component); diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index f35beb935a..fdb64e5f33 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -62,7 +62,7 @@ namespace Content.Server.Chemistry.Components /// public void Spread() { - if (Owner.Prototype == null) + if (IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype == null) { Logger.Error("AreaEffectComponent needs its owner to be spawned by a prototype."); return; @@ -83,7 +83,7 @@ namespace Content.Server.Chemistry.Components return; } - var newEffect = IoCManager.Resolve().SpawnEntity(Owner.Prototype.ID, grid.DirectionToGrid(coords, dir)); + var newEffect = IoCManager.Resolve().SpawnEntity(IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype.ID, grid.DirectionToGrid(coords, dir)); if (!newEffect.TryGetComponent(out SolutionAreaEffectComponent? effectComponent)) { diff --git a/Content.Server/Construction/Commands/TileWallsCommand.cs b/Content.Server/Construction/Commands/TileWallsCommand.cs index eeb1e32552..c088c867f9 100644 --- a/Content.Server/Construction/Commands/TileWallsCommand.cs +++ b/Content.Server/Construction/Commands/TileWallsCommand.cs @@ -74,7 +74,7 @@ namespace Content.Server.Construction.Commands continue; } - var prototype = childEntity.Prototype; + var prototype = IoCManager.Resolve().GetComponent(childEntity.Uid).EntityPrototype; while (true) { if (prototype?.Parent == null) diff --git a/Content.Server/Construction/Components/MachineComponent.cs b/Content.Server/Construction/Components/MachineComponent.cs index af6e494767..516bc57110 100644 --- a/Content.Server/Construction/Components/MachineComponent.cs +++ b/Content.Server/Construction/Components/MachineComponent.cs @@ -4,6 +4,7 @@ using Content.Server.Stack; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Construction.Components @@ -66,7 +67,7 @@ namespace Content.Server.Construction.Components if (!_boardContainer.Insert(board)) { - throw new Exception($"Couldn't insert board with prototype {BoardPrototype} to machine with prototype {Owner.Prototype?.ID ?? "N/A"}!"); + throw new Exception($"Couldn't insert board with prototype {BoardPrototype} to machine with prototype {IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype?.ID ?? "N/A"}!"); } if (!board.TryGetComponent(out var machineBoard)) @@ -81,7 +82,7 @@ namespace Content.Server.Construction.Components var p = entityManager.SpawnEntity(MachinePartComponent.Prototypes[part], Owner.Transform.Coordinates); if (!partContainer.Insert(p)) - throw new Exception($"Couldn't insert machine part of type {part} to machine with prototype {Owner.Prototype?.ID ?? "N/A"}!"); + throw new Exception($"Couldn't insert machine part of type {part} to machine with prototype {IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype?.ID ?? "N/A"}!"); } } @@ -90,7 +91,7 @@ namespace Content.Server.Construction.Components var stack = EntitySystem.Get().Spawn(amount, stackType, Owner.Transform.Coordinates); if (!partContainer.Insert(IoCManager.Resolve().GetEntity(stack))) - throw new Exception($"Couldn't insert machine material of type {stackType} to machine with prototype {Owner.Prototype?.ID ?? "N/A"}"); + throw new Exception($"Couldn't insert machine material of type {stackType} to machine with prototype {IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype?.ID ?? "N/A"}"); } foreach (var (compName, info) in machineBoard.ComponentRequirements) @@ -100,7 +101,7 @@ namespace Content.Server.Construction.Components var c = entityManager.SpawnEntity(info.DefaultPrototype, Owner.Transform.Coordinates); if(!partContainer.Insert(c)) - throw new Exception($"Couldn't insert machine component part with default prototype '{compName}' to machine with prototype {Owner.Prototype?.ID ?? "N/A"}"); + throw new Exception($"Couldn't insert machine component part with default prototype '{compName}' to machine with prototype {IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype?.ID ?? "N/A"}"); } } @@ -111,7 +112,7 @@ namespace Content.Server.Construction.Components var c = entityManager.SpawnEntity(info.DefaultPrototype, Owner.Transform.Coordinates); if(!partContainer.Insert(c)) - throw new Exception($"Couldn't insert machine component part with default prototype '{tagName}' to machine with prototype {Owner.Prototype?.ID ?? "N/A"}"); + throw new Exception($"Couldn't insert machine component part with default prototype '{tagName}' to machine with prototype {IoCManager.Resolve().GetComponent(Owner.Uid).EntityPrototype?.ID ?? "N/A"}"); } } } diff --git a/Content.Server/Construction/ConstructionSystem.cs b/Content.Server/Construction/ConstructionSystem.cs index 7aee035026..bec83689c1 100644 --- a/Content.Server/Construction/ConstructionSystem.cs +++ b/Content.Server/Construction/ConstructionSystem.cs @@ -51,13 +51,13 @@ namespace Content.Server.Construction { if (GetCurrentGraph(uid, construction) is not {} graph) { - _sawmill.Warning($"Prototype {construction.Owner.Prototype?.ID}'s construction component has an invalid graph specified."); + _sawmill.Warning($"Prototype {IoCManager.Resolve().GetComponent(construction.Owner.Uid).EntityPrototype?.ID}'s construction component has an invalid graph specified."); return; } if (GetNodeFromGraph(graph, construction.Node) is not {} node) { - _sawmill.Warning($"Prototype {construction.Owner.Prototype?.ID}'s construction component has an invalid node specified."); + _sawmill.Warning($"Prototype {IoCManager.Resolve().GetComponent(construction.Owner.Uid).EntityPrototype?.ID}'s construction component has an invalid node specified."); return; } @@ -66,7 +66,7 @@ namespace Content.Server.Construction { if (GetEdgeFromNode(node, edgeIndex) is not {} currentEdge) { - _sawmill.Warning($"Prototype {construction.Owner.Prototype?.ID}'s construction component has an invalid edge index specified."); + _sawmill.Warning($"Prototype {IoCManager.Resolve().GetComponent(construction.Owner.Uid).EntityPrototype?.ID}'s construction component has an invalid edge index specified."); return; } @@ -77,7 +77,7 @@ namespace Content.Server.Construction { if (GetNodeFromGraph(graph, targetNodeId) is not { } targetNode) { - _sawmill.Warning($"Prototype {construction.Owner.Prototype?.ID}'s construction component has an invalid target node specified."); + _sawmill.Warning($"Prototype {IoCManager.Resolve().GetComponent(construction.Owner.Uid).EntityPrototype?.ID}'s construction component has an invalid target node specified."); return; } diff --git a/Content.Server/Containers/ContainerExt.cs b/Content.Server/Containers/ContainerExt.cs index ed7c338dd0..0c89dfed27 100644 --- a/Content.Server/Containers/ContainerExt.cs +++ b/Content.Server/Containers/ContainerExt.cs @@ -1,4 +1,7 @@ using Robust.Shared.Containers; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; +using Robust.Shared.Prototypes; namespace Content.Server.Containers { @@ -11,7 +14,7 @@ namespace Content.Server.Containers { foreach (var entity in container.ContainedEntities) { - if (entity.Prototype?.ID == prototypeId) total++; + if (IoCManager.Resolve().GetComponent(entity.Uid).EntityPrototype?.ID == prototypeId) total++; if(!entity.TryGetComponent(out var component)) continue; total += component.CountPrototypeOccurencesRecursive(prototypeId); } diff --git a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs index d79ff5d458..d827364f7a 100644 --- a/Content.Server/Fluids/EntitySystems/PuddleSystem.cs +++ b/Content.Server/Fluids/EntitySystems/PuddleSystem.cs @@ -26,6 +26,7 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Player; +using Robust.Shared.Prototypes; namespace Content.Server.Fluids.EntitySystems { @@ -328,7 +329,7 @@ namespace Content.Server.Fluids.EntitySystems } puddle ??= () => - IoCManager.Resolve().SpawnEntity(puddleComponent.Owner.Prototype?.ID, + IoCManager.Resolve().SpawnEntity(IoCManager.Resolve().GetComponent(puddleComponent.Owner.Uid).EntityPrototype?.ID, mapGrid.DirectionToGrid(coords, direction)) .GetComponent(); diff --git a/Content.Server/GameTicking/Commands/MappingCommand.cs b/Content.Server/GameTicking/Commands/MappingCommand.cs index 4909402ea3..d5a98c46c6 100644 --- a/Content.Server/GameTicking/Commands/MappingCommand.cs +++ b/Content.Server/GameTicking/Commands/MappingCommand.cs @@ -6,8 +6,10 @@ using Content.Server.Administration; using Content.Shared.Administration; using Robust.Server.Player; using Robust.Shared.Console; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Prototypes; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -74,7 +76,8 @@ namespace Content.Server.GameTicking.Commands shell.ExecuteCommand($"addmap {mapId} false"); shell.ExecuteCommand($"loadbp {mapId} \"{CommandParsing.Escape(mapName)}\" true"); - if (player.AttachedEntity?.Prototype?.ID != "AdminObserver") + IEntity? tempQualifier = player.AttachedEntity; + if ((tempQualifier != null ? IoCManager.Resolve().GetComponent(tempQualifier.Uid).EntityPrototype : null)?.ID != "AdminObserver") shell.ExecuteCommand("aghost"); shell.ExecuteCommand($"tp 0 0 {mapId}"); diff --git a/Content.Server/Kitchen/Components/MicrowaveComponent.cs b/Content.Server/Kitchen/Components/MicrowaveComponent.cs index 2a33716c47..9a54f4ad83 100644 --- a/Content.Server/Kitchen/Components/MicrowaveComponent.cs +++ b/Content.Server/Kitchen/Components/MicrowaveComponent.cs @@ -29,6 +29,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Player; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -311,18 +312,18 @@ namespace Content.Server.Kitchen.Components var solidsDict = new Dictionary(); foreach (var item in _storage.ContainedEntities) { - if (item.Prototype == null) + if (IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype == null) { continue; } - if (solidsDict.ContainsKey(item.Prototype.ID)) + if (solidsDict.ContainsKey(IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype.ID)) { - solidsDict[item.Prototype.ID]++; + solidsDict[IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype.ID]++; } else { - solidsDict.Add(item.Prototype.ID, 1); + solidsDict.Add(IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype.ID, 1); } } @@ -450,12 +451,12 @@ namespace Content.Server.Kitchen.Components { foreach (var item in _storage.ContainedEntities) { - if (item.Prototype == null) + if (IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype == null) { continue; } - if (item.Prototype.ID == recipeSolid.Key) + if (IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype.ID == recipeSolid.Key) { _storage.Remove(item); item.Delete(); diff --git a/Content.Server/Stack/StackSystem.cs b/Content.Server/Stack/StackSystem.cs index 1caafeb1cc..068853b726 100644 --- a/Content.Server/Stack/StackSystem.cs +++ b/Content.Server/Stack/StackSystem.cs @@ -50,7 +50,7 @@ namespace Content.Server.Stack // Get a prototype ID to spawn the new entity. Null is also valid, although it should rarely be picked... var prototype = _prototypeManager.TryIndex(stack.StackTypeId, out var stackType) ? stackType.Spawn - : stack.Owner.Prototype?.ID; + : IoCManager.Resolve().GetComponent(stack.Owner.Uid).EntityPrototype?.ID; // Try to remove the amount of things we want to split from the original stack... if (!Use(uid, amount, stack)) diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index ce8c761d4a..6a09884b9a 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -330,7 +330,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components else { projectile = - IoCManager.Resolve().SpawnEntity(baseProjectile.Prototype?.ID, baseProjectile.Transform.Coordinates); + IoCManager.Resolve().SpawnEntity(IoCManager.Resolve().GetComponent(baseProjectile.Uid).EntityPrototype?.ID, baseProjectile.Transform.Coordinates); } firedProjectiles[i] = projectile.Uid; diff --git a/Content.Shared/Body/Components/SharedBodyPartComponent.cs b/Content.Shared/Body/Components/SharedBodyPartComponent.cs index 5c55116941..ef6c2ae37f 100644 --- a/Content.Shared/Body/Components/SharedBodyPartComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyPartComponent.cs @@ -8,6 +8,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; @@ -113,7 +114,7 @@ namespace Content.Shared.Body.Components protected virtual void OnAddMechanism(SharedMechanismComponent mechanism) { - var prototypeId = mechanism.Owner.Prototype!.ID; + var prototypeId = IoCManager.Resolve().GetComponent(mechanism.Owner.Uid).EntityPrototype!.ID; if (!_mechanismIds.Contains(prototypeId)) { @@ -128,7 +129,7 @@ namespace Content.Shared.Body.Components protected virtual void OnRemoveMechanism(SharedMechanismComponent mechanism) { - _mechanismIds.Remove(mechanism.Owner.Prototype!.ID); + _mechanismIds.Remove(IoCManager.Resolve().GetComponent(mechanism.Owner.Uid).EntityPrototype!.ID); mechanism.Part = null; SizeUsed -= mechanism.Size;