From 535467028860f037844b9f35242398286c58edee Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Tue, 7 Aug 2018 11:36:53 +0300 Subject: [PATCH] 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 --- Barotrauma/BarotraumaClient/Source/Items/Item.cs | 3 ++- Barotrauma/BarotraumaShared/Source/Items/Item.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Items/Item.cs b/Barotrauma/BarotraumaClient/Source/Items/Item.cs index 437e302a3..05c5f7a0b 100644 --- a/Barotrauma/BarotraumaClient/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaClient/Source/Items/Item.cs @@ -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); diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index a037b0c81..bad381cb9 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -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)) {