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.
This commit is contained in:
Charlese2
2021-12-15 15:35:56 -07:00
committed by GitHub
parent 906d9dd159
commit b679980278

View File

@@ -127,15 +127,11 @@ namespace Content.Server.Flash
flashable.LastFlash = _gameTiming.CurTime; flashable.LastFlash = _gameTiming.CurTime;
flashable.Duration = flashDuration / 1000f; // TODO: Make this sane... flashable.Duration = flashDuration / 1000f; // TODO: Make this sane...
flashable.Dirty(); flashable.Dirty();
}
_stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(flashDuration/1000f), true, _stunSystem.TrySlowdown(target, TimeSpan.FromSeconds(flashDuration/1000f), true,
slowTo, slowTo); slowTo, slowTo);
if (displayPopup && user != null && target != user) if (displayPopup && user != null && target != user && EntityManager.EntityExists(user.Value))
{
// TODO Resolving the EntityUidhere bad.
if (EntityManager.EntityExists(user.Value) && EntityManager.EntityExists(target))
{ {
user.Value.PopupMessage(target, Loc.GetString("flash-component-user-blinds-you", user.Value.PopupMessage(target, Loc.GetString("flash-component-user-blinds-you",
("user", user.Value))); ("user", user.Value)));