]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
fixes for bot_cmd
authorRudolf Polzer <divverent@xonotic.org>
Fri, 14 Sep 2012 11:31:22 +0000 (13:31 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 14 Sep 2012 11:31:22 +0000 (13:31 +0200)
qcsrc/server/command/sv_cmd.qc

index f3d6d5999ff6ed65f76674f5903b93f2e642ee3e..269b69fc873b98a0993c8ec79a56a996a4f4cf74 100644 (file)
@@ -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") \