Fix news management console publish timeout activating when nothing was published (#31161)

Fix news management console updating publish timeout, now updating it *after* access checks instead of before
This commit is contained in:
Red Mushie
2024-08-19 04:56:58 +02:00
committed by GitHub
parent 19b0ce3007
commit 91e2fdc4b9

View 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;