Removed inlined out variables from PropertyConditional. Didn't realize this was a C# 7 only feature.

This commit is contained in:
Joonas Rikkonen
2018-01-09 18:26:34 +02:00
parent 3956785032
commit 6fff303d30
@@ -119,7 +119,8 @@ namespace Barotrauma
switch (Type) switch (Type)
{ {
case ConditionType.PropertyValue: case ConditionType.PropertyValue:
if (target.SerializableProperties.TryGetValue(PropertyName.ToLowerInvariant(), out SerializableProperty property)) SerializableProperty property;
if (target.SerializableProperties.TryGetValue(PropertyName.ToLowerInvariant(), out property))
{ {
return Matches(property); return Matches(property);
} }
@@ -194,7 +195,8 @@ namespace Barotrauma
float? floatProperty = null; float? floatProperty = null;
if (type == typeof(float) || type == typeof(int)) if (type == typeof(float) || type == typeof(int))
{ {
if (Single.TryParse(Value, NumberStyles.Float, CultureInfo.InvariantCulture, out float parsedFloat)) float parsedFloat;
if (Single.TryParse(Value, NumberStyles.Float, CultureInfo.InvariantCulture, out parsedFloat))
{ {
floatValue = parsedFloat; floatValue = parsedFloat;
} }