Make addgamerule command process only valid game rules (#29912)

* addgamerule command processes only valid rules

* Update

* English moment
This commit is contained in:
Winkarst
2024-07-15 22:18:33 +03:00
committed by GitHub
parent b35539db4a
commit 33a303236c

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