Fix multiple commands execution in adminmenu_custom.txt

This PR fixes the semicolon parsing issue for adminmenu_custom.txt - player type cmd execution.

Below is an example ```adminmenu_custom.txt``` to reproduce the semicolon ";" not working before this fix - multiple commands delimited with ";" will not work.

```
"Commands"
{
	"ServerCommands"
	{
		"AntiCheat"
		{
			"admin"	"sm_ban"

			"Enable KACR"
			{
				"cmd"	"sm plugins load disabled/kigen-ac_redux; sm_chat KACR is enabled"
				"execute"	"server"
			}
		}
	}
}
```
This commit is contained in:
Roman Kováč 2025-03-22 02:18:33 +07:00 committed by GitHub
parent 5e3dc6c6c4
commit e42a878576
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -584,14 +584,22 @@ public void ParamCheck(int client)
char unquotedCommand[CMD_LENGTH];
UnQuoteString(g_command[client], unquotedCommand, sizeof(unquotedCommand), "#@");
if (outputItem.execute == Execute_Player) // assume 'player' type execute option
// Use commands directly without unnecessary unquoting
char commands[10][CMD_LENGTH];
int count = ExplodeString(g_command[client], ";", commands, sizeof(commands), sizeof(commands[]));
for (int i = 0; i < count; i++)
{
FakeClientCommand(client, unquotedCommand);
}
else // assume 'server' type execute option
{
InsertServerCommand(unquotedCommand);
ServerExecute();
TrimString(commands[i]);
if (outputItem.execute == Execute_Player) // assume 'player' type execute option
{
FakeClientCommand(client, commands[i]);
}
else // assume 'server' type execute option
{
InsertServerCommand(commands[i]);
ServerExecute();
}
}
g_command[client][0] = '\0';