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:
Regalis
2016-02-26 22:21:00 +02:00
parent 77d3d22810
commit 9f8f4e290e
19 changed files with 330 additions and 133 deletions
+16 -8
View File
@@ -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;
}