Fixed StatusEffects being multiplied by deltatime when a client uses an item with the "use on self" buttons (even though the effect should be instantaneous). Caused effects with no duration to do almost nothing, making calyxanide and other meds with instantaneous effects basically useless. Closes #587

This commit is contained in:
Joonas Rikkonen
2018-08-07 11:36:53 +03:00
parent 2d18da40eb
commit 5354670288
2 changed files with 3 additions and 2 deletions
@@ -402,7 +402,8 @@ namespace Barotrauma
ushort targetID = msg.ReadUInt16();
Character target = FindEntityByID(targetID) as Character;
ApplyStatusEffects(actionType, (float)Timing.Step, target, true);
//ignore deltatime - using an item with the useOnSelf buttons is instantaneous
ApplyStatusEffects(actionType, 1.0f, target, true);
break;
case NetEntityEvent.Type.ChangeProperty:
ReadPropertyChange(msg);
@@ -1457,7 +1457,7 @@ namespace Barotrauma
case NetEntityEvent.Type.ApplyStatusEffect:
if (c.Character == null || !c.Character.CanInteractWith(this)) return;
ApplyStatusEffects(ActionType.OnUse, (float)Timing.Step, c.Character);
ApplyStatusEffects(ActionType.OnUse, 1.0f, c.Character);
if (ContainedItems == null || ContainedItems.All(i => i == null))
{