improvement on gm windows, ai
This commit is contained in:
@@ -224,6 +224,23 @@ internal sealed class SpatialBuilder
|
||||
|
||||
private static CelestialRuntime? ResolveResourceNodeAnchor(SystemSpatialGraph graph, ResourceNodeDefinition definition)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(definition.AnchorReference))
|
||||
{
|
||||
var anchorId = definition.AnchorReference.ToLowerInvariant() switch
|
||||
{
|
||||
var reference when reference.StartsWith("star-", StringComparison.Ordinal)
|
||||
=> $"node-{graph.SystemId}-{reference}",
|
||||
var reference when reference.StartsWith("planet-", StringComparison.Ordinal)
|
||||
=> $"node-{graph.SystemId}-{reference}",
|
||||
_ => null,
|
||||
};
|
||||
|
||||
if (anchorId is not null)
|
||||
{
|
||||
return graph.Celestials.FirstOrDefault(c => string.Equals(c.Id, anchorId, StringComparison.Ordinal));
|
||||
}
|
||||
}
|
||||
|
||||
if (definition.AnchorPlanetIndex is not int planetIndex || planetIndex < 0)
|
||||
{
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user