From 33a303236c010fd3a5bd41ad449ae7447ae817f2 Mon Sep 17 00:00:00 2001 From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Date: Mon, 15 Jul 2024 22:18:33 +0300 Subject: [PATCH] Make addgamerule command process only valid game rules (#29912) * addgamerule command processes only valid rules * Update * English moment --- Content.Server/GameTicking/GameTicker.GameRule.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Content.Server/GameTicking/GameTicker.GameRule.cs b/Content.Server/GameTicking/GameTicker.GameRule.cs index 2a33d01bd0..c10f302347 100644 --- a/Content.Server/GameTicking/GameTicker.GameRule.cs +++ b/Content.Server/GameTicking/GameTicker.GameRule.cs @@ -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"); -- 2.51.2