Made statuseffects stackable by default, fixed statuseffects only being considered the same if they're caused by the same item, applying the same non-stackable statuseffect again refreshes the timer of the existing statuseffect. Closes #309

This commit is contained in:
Joonas Rikkonen
2018-03-05 16:59:23 +02:00
parent 6ddcd65f18
commit a57bec2a27
2 changed files with 13 additions and 8 deletions
@@ -26,7 +26,7 @@ namespace Barotrauma
public override void Apply(ActionType type, float deltaTime, Entity entity, ISerializableEntity target)
{
if (this.type != type || !HasRequiredItems(entity)) return;
if (!Stackable && DelayList.Any(d => d.Parent == this && d.Entity == entity && d.Targets.Count == 1 && d.Targets[0] == target)) return;
if (!Stackable && DelayList.Any(d => d.Parent == this && d.Targets.Count == 1 && d.Targets[0] == target)) return;
if (targetNames != null && !targetNames.Contains(target.Name)) return;
@@ -44,7 +44,7 @@ namespace Barotrauma
public override void Apply(ActionType type, float deltaTime, Entity entity, List<ISerializableEntity> targets)
{
if (this.type != type || !HasRequiredItems(entity)) return;
if (!Stackable && DelayList.Any(d => d.Parent == this && d.Entity == entity && d.Targets.SequenceEqual(targets))) return;
if (!Stackable && DelayList.Any(d => d.Parent == this && d.Targets.SequenceEqual(targets))) return;
//remove invalid targets
if (targetNames != null)