From 610ae7dd7a551ca4d99c305e03f6c760c806f1f3 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 14 Sep 2012 13:31:22 +0200 Subject: [PATCH] fixes for bot_cmd --- qcsrc/server/command/sv_cmd.qc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index f3d6d5999..269b69fc8 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -316,7 +316,7 @@ void GameCommand_bbox(float request) } } -void GameCommand_bot_cmd(float request, float argc) +void GameCommand_bot_cmd(float request, float argc, string command) { switch(request) { @@ -365,7 +365,7 @@ void GameCommand_bot_cmd(float request, float argc) if(bot == world) bot = find_bot_by_name(argv(2)); if(bot) - bot_queuecommand(bot, strcat(argv(3), " ", argv(4))); + bot_queuecommand(bot, substring(s, argv_start_index(3), -1)); } } else @@ -392,8 +392,8 @@ void GameCommand_bot_cmd(float request, float argc) bot = find_bot_by_name(argv(1)); if(bot) { - print(strcat("Command '", strcat(argv(2), " ", argv(3)), "' sent to bot ", bot.netname, "\n")); - bot_queuecommand(bot, strcat(argv(2), " ", argv(3))); + print(strcat("Command '", substring(command, argv_start_index(2), -1), "' sent to bot ", bot.netname, "\n")); + bot_queuecommand(bot, substring(command, argv_start_index(2), -1)); return; } else @@ -1660,7 +1660,7 @@ void GameCommand_(float request) SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \ SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \ SERVER_COMMAND("bbox", GameCommand_bbox(request), "Print detailed information about world size") \ - SERVER_COMMAND("bot_cmd", GameCommand_bot_cmd(request, arguments), "Control and send commands to bots") \ + SERVER_COMMAND("bot_cmd", GameCommand_bot_cmd(request, arguments, command), "Control and send commands to bots") \ SERVER_COMMAND("cointoss", GameCommand_cointoss(request, arguments), "Flip a virtual coin and give random result") \ SERVER_COMMAND("database", GameCommand_database(request, arguments), "Extra controls of the serverprogs database") \ SERVER_COMMAND("defer_clear", GameCommand_defer_clear(request, arguments), "Clear all queued defer commands for a specific client") \ -- 2.39.2