From b679980278c44e473dac209d09ec7e3eb09bc044 Mon Sep 17 00:00:00 2001 From: Charlese2 Date: Wed, 15 Dec 2021 15:35:56 -0700 Subject: [PATCH] Fix handheld flash spamming the server console when used. (#5791) * Moves the actions of the flash code into the check for FlashableComponent * Combined if statments. --- Content.Server/Flash/FlashSystem.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 1471a5e2ec..6e20ae02d5 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -127,15 +127,11 @@ namespace Content.Server.Flash flashable.LastFlash = _gameTiming.CurTime; flashable.Duration = flashDuration / 1000f; // TODO: Make this sane... flashable.Dirty(); - } - _stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(flashDuration/1000f), true, - slowTo, slowTo); + _stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(flashDuration/1000f), true, + slowTo, slowTo); - if (displayPopup && user != null && target != user) - { - // TODO Resolving the EntityUidhere bad. - if (EntityManager.EntityExists(user.Value) && EntityManager.EntityExists(target)) + if (displayPopup && user != null && target != user && EntityManager.EntityExists(user.Value)) { user.Value.PopupMessage(target, Loc.GetString("flash-component-user-blinds-you", ("user", user.Value)));