September 24th Hotfix
Fixed some problematic harvester behavior Implemented 10% build time reduction for Turkey Neutral structures are capturable in multiplayer again (except for STRUCT_V01) Other misc. fixes
This commit is contained in:
parent
fd05be35c1
commit
7d496e8a63
40 changed files with 226 additions and 264 deletions
|
@ -533,7 +533,33 @@ namespace MobiusEditor.Utility
|
|||
var converter = propertyDescriptors.Find(property.Name, false)?.Converter ?? TypeDescriptor.GetConverter(property.PropertyType);
|
||||
if (converter.CanConvertFrom(context, typeof(string)))
|
||||
{
|
||||
property.SetValue(data, converter.ConvertFromString(context, section[property.Name]));
|
||||
try
|
||||
{
|
||||
property.SetValue(data, converter.ConvertFromString(context, section[property.Name]));
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
if (property.PropertyType == typeof(bool))
|
||||
{
|
||||
var value = section[property.Name].ToLower();
|
||||
if (value == "no")
|
||||
{
|
||||
property.SetValue(data, false);
|
||||
}
|
||||
else if (value == "yes")
|
||||
{
|
||||
property.SetValue(data, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue