Make MappingDataNode use string keys (#36111)

* MappingDataNode string keys

* a

* poke
This commit is contained in:
Leon Friedrich
2025-04-18 19:28:22 +10:00
committed by GitHub
parent 644cce2b9f
commit e4f3d19094
6 changed files with 19 additions and 34 deletions

View File

@@ -33,7 +33,7 @@ public sealed class MapMigrationSystem : EntitySystem
return;
// Verify that all of the entries map to valid entity prototypes.
foreach (var node in mappings.Values)
foreach (var node in mappings.Children.Values)
{
var newId = ((ValueDataNode) node).Value;
if (!string.IsNullOrEmpty(newId) && newId != "null")
@@ -66,13 +66,13 @@ public sealed class MapMigrationSystem : EntitySystem
foreach (var (key, value) in mappings)
{
if (key is not ValueDataNode keyNode || value is not ValueDataNode valueNode)
if (value is not ValueDataNode valueNode)
continue;
if (string.IsNullOrWhiteSpace(valueNode.Value) || valueNode.Value == "null")
ev.DeletedPrototypes.Add(keyNode.Value);
ev.DeletedPrototypes.Add(key);
else
ev.RenamedPrototypes.Add(keyNode.Value, valueNode.Value);
ev.RenamedPrototypes.Add(key, valueNode.Value);
}
}
}