LoadFromDocument properly detects duplicate entities (#3448)

I circled back around to this and discovered that the fix is (probably?) easy.

Closes #3079

I tested this locally but I'm pushing the change via the web editor so I don't have to go to the trouble of setting up a Robust fork of my own.
This commit is contained in:
Mervill
2022-11-10 00:37:47 -08:00
committed by GitHub
parent 338fcd5fcb
commit 2629fd3efb

View File

@@ -786,7 +786,7 @@ namespace Robust.Shared.Prototypes
if (!datanode.TryGet<ValueDataNode>(IdDataFieldAttribute.Name, out var idNode))
throw new PrototypeLoadException($"Prototype type {type} is missing an 'id' datafield.");
if (!overwrite && _prototypes[prototypeType].ContainsKey(idNode.Value))
if (!overwrite && _prototypeResults[prototypeType].ContainsKey(idNode.Value))
{
throw new PrototypeLoadException($"Duplicate ID: '{idNode.Value}'");
}