Fix guide generator

This commit is contained in:
Morb0 2024-01-10 00:47:40 +03:00
parent a81a423d45
commit a703df116a
2 changed files with 4 additions and 2 deletions

View file

@ -3,6 +3,7 @@ using Robust.Shared.Prototypes;
using Content.Shared.Construction;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Construction.Steps;
using Robust.Server.GameObjects;
namespace Content.Server.GuideGenerator;
@ -65,7 +66,7 @@ public sealed class HeatableRecipeEntry
{
var nodeStep = (TemperatureConstructionGraphStep)nodeStepRaw;
graphID = nodeEdge.Target; // required to check when we need to leave second loop; this is the best solution, because nodeEdge.Target is marked as required datafield and cannot be null
EntityManager em = new();
ServerEntityManager em = new();
MinTemp = nodeStep.MinTemperature.HasValue ? nodeStep.MinTemperature.Value : 0;
Result = nodeStep.MinTemperature.HasValue ? constructionProto.Nodes[nodeEdge.Target].Entity.GetId(null, null, new GraphNodeEntityArgs(em)) : null;
break;

View file

@ -3,6 +3,7 @@ using Robust.Shared.Prototypes;
using Content.Shared.Construction;
using Content.Shared.Construction.Prototypes;
using Content.Shared.Construction.Steps;
using Robust.Server.GameObjects;
namespace Content.Server.GuideGenerator;
@ -68,7 +69,7 @@ public sealed class ToolRecipeEntry // because of https://github.com/space-wizar
{
var nodeStep = (ToolConstructionGraphStep)nodeStepRaw;
graphID = nodeEdge.Target; // required to check when we need to leave second loop; this is the best solution, because nodeEdge.Target is marked as required datafield and cannot be null
EntityManager em = new();
ServerEntityManager em = new();
Tool = nodeStep.Tool;
Result = constructionProto.Nodes[nodeEdge.Target].Entity.GetId(null, null, new GraphNodeEntityArgs(em));
break;