Build 0.20.7.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user