Machine-code cleanup (#28489)

This commit is contained in:
Nemanja
2024-06-05 16:23:23 -04:00
committed by GitHub
parent 8a7b0f675e
commit 729e67af7f
31 changed files with 350 additions and 979 deletions

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Construction
// If the set graph prototype does not exist, also return null. This could be due to admemes changing values
// in ViewVariables, so even though the construction state is invalid, just return null.
return _prototypeManager.TryIndex(construction.Graph, out ConstructionGraphPrototype? graph) ? graph : null;
return PrototypeManager.TryIndex(construction.Graph, out ConstructionGraphPrototype? graph) ? graph : null;
}
/// <summary>
@@ -300,7 +300,7 @@ namespace Content.Server.Construction
}
// Exit if the new entity's prototype is the same as the original, or the prototype is invalid
if (newEntity == metaData.EntityPrototype?.ID || !_prototypeManager.HasIndex<EntityPrototype>(newEntity))
if (newEntity == metaData.EntityPrototype?.ID || !PrototypeManager.HasIndex<EntityPrototype>(newEntity))
return null;
// [Optional] Exit if the new entity's prototype is a parent of the original
@@ -310,7 +310,7 @@ namespace Content.Server.Construction
if (GetCurrentNode(uid, construction)?.DoNotReplaceInheritingEntities == true &&
metaData.EntityPrototype?.ID != null)
{
var parents = _prototypeManager.EnumerateParents<EntityPrototype>(metaData.EntityPrototype.ID)?.ToList();
var parents = PrototypeManager.EnumerateParents<EntityPrototype>(metaData.EntityPrototype.ID)?.ToList();
if (parents != null && parents.Any(x => x.ID == newEntity))
return null;
@@ -427,7 +427,7 @@ namespace Content.Server.Construction
if (!Resolve(uid, ref construction))
return false;
if (!_prototypeManager.TryIndex<ConstructionGraphPrototype>(graphId, out var graph))
if (!PrototypeManager.TryIndex<ConstructionGraphPrototype>(graphId, out var graph))
return false;
if(GetNodeFromGraph(graph, nodeId) is not {})