Parse Enum *ValueInit as string values, not integers.

This commit is contained in:
Paul Chote
2020-06-14 00:54:23 +01:00
committed by reaperrr
parent e5a1a8a706
commit 86305879cb

View File

@@ -117,8 +117,7 @@ namespace OpenRA
public virtual void Initialize(MiniYaml yaml)
{
var valueType = typeof(T).IsEnum ? Enum.GetUnderlyingType(typeof(T)) : typeof(T);
Initialize((T)FieldLoader.GetValue("value", valueType, yaml.Value));
Initialize((T)FieldLoader.GetValue("value", typeof(T), yaml.Value));
}
public virtual void Initialize(T value)