Fixed item tags & aliases not being taken into account when determining target validity in StatusEffect.Apply. Closes #316

This commit is contained in:
Joonas Rikkonen
2018-03-06 11:25:25 +02:00
parent 8c04722385
commit f5af432ad9
3 changed files with 33 additions and 1 deletions
@@ -299,7 +299,20 @@ namespace Barotrauma
//remove invalid targets
if (targetNames != null)
{
targets.RemoveAll(t => !targetNames.Contains(t.Name));
targets.RemoveAll(t =>
{
Item item = t as Item;
if (item == null)
{
return !targetNames.Contains(t.Name);
}
else
{
if (item.HasTag(targetNames)) return false;
if (item.Prefab.NameMatches(targetNames)) return false;
}
return true;
});
if (targets.Count == 0) return;
}