Build 0.20.7.0

This commit is contained in:
Markus Isberg
2022-11-18 18:13:38 +02:00
parent 8c8fd865c5
commit ecb6d40b4b
111 changed files with 1346 additions and 701 deletions
@@ -416,22 +416,26 @@ namespace Barotrauma
return false;
}
switch (Operator)
{
case OperatorType.Equals:
if (type == typeof(bool))
{
return property.GetBoolValue(target) == (AttributeValue == "true" || AttributeValue == "True");
if (type == typeof(bool))
{
return property.GetBoolValue(target) == (AttributeValue == "true" || AttributeValue == "True");
}
var value = property.GetValue(target);
return Equals(value, AttributeValue);
}
return property.GetValue(target).ToString().Equals(AttributeValue);
case OperatorType.NotEquals:
if (type == typeof(bool))
{
return property.GetBoolValue(target) != (AttributeValue == "true" || AttributeValue == "True");
if (type == typeof(bool))
{
return property.GetBoolValue(target) != (AttributeValue == "true" || AttributeValue == "True");
}
var value = property.GetValue(target);
return !Equals(value, AttributeValue);
}
return !property.GetValue(target).ToString().Equals(AttributeValue);
case OperatorType.GreaterThan:
case OperatorType.LessThanEquals:
case OperatorType.LessThan:
@@ -441,6 +445,18 @@ namespace Barotrauma
break;
}
return false;
static bool Equals(object value, string desiredValue)
{
if (value == null)
{
return desiredValue.Equals("null", StringComparison.OrdinalIgnoreCase);
}
else
{
return value.ToString().Equals(desiredValue);
}
}
}
}