Fixed propulsion applying force to _every limb except_ the ones it's supposed to, fixed pressure building up in enclosed rooms that are full of water, fixed netlobby displaying multiple votes for clients, progress on file transfer
This commit is contained in:
@@ -207,6 +207,11 @@ namespace Barotrauma
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
public static Dictionary<string, ObjectProperty> InitProperties(object obj)
|
||||
{
|
||||
return InitProperties(obj, null);
|
||||
}
|
||||
|
||||
public static Dictionary<string, ObjectProperty> InitProperties(object obj, XElement element)
|
||||
{
|
||||
var properties = TypeDescriptor.GetProperties(obj.GetType()).Cast<PropertyDescriptor>();
|
||||
@@ -226,16 +231,19 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
|
||||
//go through all the attributes in the xml element
|
||||
//and set the value of the matching property if it is initializable
|
||||
foreach (XAttribute attribute in element.Attributes())
|
||||
if (element!=null)
|
||||
{
|
||||
ObjectProperty property = null;
|
||||
if (!dictionary.TryGetValue(attribute.Name.ToString().ToLower(), out property)) continue;
|
||||
if (!property.Attributes.OfType<HasDefaultValue>().Any()) continue;
|
||||
property.TrySetValue(attribute.Value);
|
||||
//go through all the attributes in the xml element
|
||||
//and set the value of the matching property if it is initializable
|
||||
foreach (XAttribute attribute in element.Attributes())
|
||||
{
|
||||
ObjectProperty property = null;
|
||||
if (!dictionary.TryGetValue(attribute.Name.ToString().ToLower(), out property)) continue;
|
||||
if (!property.Attributes.OfType<HasDefaultValue>().Any()) continue;
|
||||
property.TrySetValue(attribute.Value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user