From 86305879cb6d8a059137598b9072dd2b03210198 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 14 Jun 2020 00:54:23 +0100 Subject: [PATCH] Parse Enum *ValueInit as string values, not integers. --- OpenRA.Game/Map/ActorInitializer.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenRA.Game/Map/ActorInitializer.cs b/OpenRA.Game/Map/ActorInitializer.cs index cf8fb0114a..269391b686 100644 --- a/OpenRA.Game/Map/ActorInitializer.cs +++ b/OpenRA.Game/Map/ActorInitializer.cs @@ -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)