]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix news management console publish timeout activating when nothing was published...
authorRed Mushie <82113471+redmushie@users.noreply.github.com>
Mon, 19 Aug 2024 02:56:58 +0000 (04:56 +0200)
committerGitHub <noreply@github.com>
Mon, 19 Aug 2024 02:56:58 +0000 (20:56 -0600)
Fix news management console updating publish timeout, now updating it *after* access checks instead of before

Content.Server/MassMedia/Systems/NewsSystem.cs

index 652c3dae897915245e6c7518b76d97b97e682a13..6d3a3cc5055cedef18621153d82f54edfea8e291 100644 (file)
@@ -132,15 +132,15 @@ public sealed class NewsSystem : SharedNewsSystem
         if (!ent.Comp.PublishEnabled)
             return;
 
-        ent.Comp.PublishEnabled = false;
-        ent.Comp.NextPublish = _timing.CurTime + TimeSpan.FromSeconds(ent.Comp.PublishCooldown);
-
         if (!TryGetArticles(ent, out var articles))
             return;
 
         if (!CanUse(msg.Actor, ent.Owner))
             return;
 
+        ent.Comp.PublishEnabled = false;
+        ent.Comp.NextPublish = _timing.CurTime + TimeSpan.FromSeconds(ent.Comp.PublishCooldown);
+
         string? authorName = null;
         if (_idCardSystem.TryFindIdCard(msg.Actor, out var idCard))
             authorName = idCard.Comp.FullName;