From 7089b607388d9188b584dad5ad693af705a3e9bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Tue, 23 Jun 2020 21:05:25 +0200 Subject: [PATCH] Rejuvenate now resets stuns. Fixes #1198 --- .../GameObjects/Components/Mobs/StunnableComponent.cs | 11 +++++++++++ Content.Server/GlobalVerbs/RejuvenateVerb.cs | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs b/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs index 8948752b88..fbbd165230 100644 --- a/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs +++ b/Content.Server/GameObjects/Components/Mobs/StunnableComponent.cs @@ -192,6 +192,17 @@ namespace Content.Server.GameObjects.Components.Mobs _statusRemoveCancellation = new CancellationTokenSource(); } + public void ResetStuns() + { + _stunnedTimer = 0f; + _slowdownTimer = 0f; + + if (KnockedDown) + StandingStateHelper.Standing(Owner); + + _knockdownTimer = 0f; + } + public void Update(float delta) { if (Stunned) diff --git a/Content.Server/GlobalVerbs/RejuvenateVerb.cs b/Content.Server/GlobalVerbs/RejuvenateVerb.cs index cf141019b6..3c2c69da6f 100644 --- a/Content.Server/GlobalVerbs/RejuvenateVerb.cs +++ b/Content.Server/GlobalVerbs/RejuvenateVerb.cs @@ -1,4 +1,5 @@ using Content.Server.GameObjects; +using Content.Server.GameObjects.Components.Mobs; using Content.Server.GameObjects.Components.Nutrition; using Content.Shared.GameObjects; using Robust.Server.Console; @@ -62,6 +63,10 @@ namespace Content.Server.GlobalVerbs { thirst.ResetThirst(); } + if (target.TryGetComponent(out StunnableComponent stun)) + { + stun.ResetStuns(); + } } } }