From 45c60315561d214ef13d2d17ef2d4986491c85e5 Mon Sep 17 00:00:00 2001 From: "Mr. Blue" Date: Wed, 6 Dec 2023 00:30:13 +0100 Subject: [PATCH] Fix covalence chat commands not working --- src/RustHooks.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RustHooks.cs b/src/RustHooks.cs index c8121515c..06e881043 100644 --- a/src/RustHooks.cs +++ b/src/RustHooks.cs @@ -290,7 +290,7 @@ private object IOnPlayerChat(ulong playerId, string playerName, string message, string chatCommandPrefix = CommandHandler.GetChatCommandPrefix(message); if ( chatCommandPrefix != null ) { - TryRunPlayerCommand( basePlayer, message.Substring( chatCommandPrefix.Length ) ); + TryRunPlayerCommand( basePlayer, message, chatCommandPrefix ); return false; } @@ -315,7 +315,7 @@ private object IOnPlayerChat(ulong playerId, string playerName, string message, /// /// /// - private void TryRunPlayerCommand(BasePlayer basePlayer, string message) + private void TryRunPlayerCommand(BasePlayer basePlayer, string message, string commandPrefix) { if (basePlayer == null) { @@ -331,7 +331,7 @@ private void TryRunPlayerCommand(BasePlayer basePlayer, string message) } // Parse the command - ParseCommand(str, out string cmd, out string[] args); + ParseCommand(str.Substring(commandPrefix.Length), out string cmd, out string[] args); if (cmd == null) { return;