]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make addgamerule command process only valid game rules (#29912)
authorWinkarst <74284083+Winkarst-cpu@users.noreply.github.com>
Mon, 15 Jul 2024 19:18:33 +0000 (22:18 +0300)
committerGitHub <noreply@github.com>
Mon, 15 Jul 2024 19:18:33 +0000 (21:18 +0200)
* addgamerule command processes only valid rules

* Update

* English moment

Content.Server/GameTicking/GameTicker.GameRule.cs

index 2a33d01bd09e2c2778c11e71836acfa53c63484f..c10f3023471e8a8ec455517385434489eb600338 100644 (file)
@@ -324,6 +324,13 @@ public sealed partial class GameTicker
 
         foreach (var rule in args)
         {
+            if (!_prototypeManager.HasIndex(rule))
+            {
+                shell.WriteError($"Invalid game rule {rule} was skipped.");
+
+                continue;
+            }
+
             if (shell.Player != null)
             {
                 _adminLogger.Add(LogType.EventStarted, $"{shell.Player} tried to add game rule [{rule}] via command");