Skip to content

Commit

Permalink
Fix covalence chat commands not working
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBlue committed Dec 5, 2023
1 parent 90e1b26 commit 45c6031
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/RustHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -315,7 +315,7 @@ private object IOnPlayerChat(ulong playerId, string playerName, string message,
/// <param name="basePlayer"></param>
/// <param name="message"></param>
/// <returns></returns>
private void TryRunPlayerCommand(BasePlayer basePlayer, string message)
private void TryRunPlayerCommand(BasePlayer basePlayer, string message, string commandPrefix)
{
if (basePlayer == null)
{
Expand All @@ -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;
Expand Down

0 comments on commit 45c6031

Please sign in to comment.