817c58e...af8a4af
commit af8a4af10c665a1f539c008a9440b4f89df55fa5 Author: Joonas Rikkonen <poe.regalis@gmail.com> Date: Tue Mar 19 15:06:21 2019 +0200 Fixed default StatusEffect conditional comparison type back to OR. Using AND caused a variety of bugs, for example flares would not activate or oxygen tanks explode when on fire because the conditional would have to be true on all the components of the item, and the Item object itself. Closes #1307
This commit is contained in:
@@ -107,7 +107,7 @@ namespace Barotrauma
|
||||
public string[] propertyNames;
|
||||
private object[] propertyEffects;
|
||||
|
||||
private PropertyConditional.Comparison conditionalComparison = PropertyConditional.Comparison.And;
|
||||
private PropertyConditional.Comparison conditionalComparison = PropertyConditional.Comparison.Or;
|
||||
private List<PropertyConditional> propertyConditionals;
|
||||
|
||||
private bool setValue;
|
||||
@@ -465,6 +465,13 @@ namespace Barotrauma
|
||||
if (target == null || target.SerializableProperties == null) { continue; }
|
||||
foreach (PropertyConditional pc in propertyConditionals)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pc.TargetItemComponentName))
|
||||
{
|
||||
if (!(target is ItemComponent ic) || ic.GetType().ToString() != pc.TargetItemComponentName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (pc.Matches(target)) { return true; }
|
||||
}
|
||||
}
|
||||
@@ -475,6 +482,13 @@ namespace Barotrauma
|
||||
if (target == null || target.SerializableProperties == null) { continue; }
|
||||
foreach (PropertyConditional pc in propertyConditionals)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(pc.TargetItemComponentName))
|
||||
{
|
||||
if (!(target is ItemComponent ic) || ic.GetType().ToString() != pc.TargetItemComponentName)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!pc.Matches(target)) { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user