]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/sv_cmd.qc
Temporarily disable centerprint that your team mate got the flag (merlijn)
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / sv_cmd.qc
index 98d877c436beaea85e0b0a438091c3462bec8864..269b69fc873b98a0993c8ec79a56a996a4f4cf74 100644 (file)
@@ -81,6 +81,7 @@ void GameCommand_adminmsg(float request, float argc)
                        float infobartime = stof(argv(3));
                        
                        string successful, t;
+                       successful = string_null;
                        
                        if((targets) && (admin_message))
                        {
@@ -117,7 +118,7 @@ void GameCommand_adminmsg(float request, float argc)
                                if(successful)
                                        bprint("Successfully sent message '", admin_message, "' to ", successful, ".\n");
                                else
-                                       print("No players given (", original_targets, ") could recieve the message.\n");
+                                       print("No players given (", original_targets, ") could receive the message.\n");
                                        
                                return;
                        }
@@ -166,7 +167,7 @@ void GameCommand_allspec(float request, float argc)
                {
                        entity client;
                        string reason = argv(1);
-                       float i;
+                       float i = 0;
                        
                        FOR_EACH_REALPLAYER(client)
                        {
@@ -315,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)
        {
@@ -364,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
@@ -391,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
@@ -528,7 +529,7 @@ void GameCommand_defer_clear_all(float request)
                case CMD_REQUEST_COMMAND:
                {
                        entity client;
-                       float i;
+                       float i = 0;
                        float argc;
                        
                        FOR_EACH_CLIENT(client)
@@ -904,6 +905,7 @@ void GameCommand_moveplayer(float request, float argc)
                        string notify = argv(3);
                        
                        string successful, t;
+                       successful = string_null;
                        
                        // lets see if the target(s) even actually exist.
                        if((targets) && (destination))
@@ -1238,10 +1240,12 @@ void GameCommand_shuffleteams(float request)
                {
                        if(teamplay)
                        {
-                               entity tmp_player, client;
-                               float i, x, z, t_teams, t_players, team_color, accepted;
+                               entity tmp_player;
+                               float i, x, z, t_teams, t_players, team_color;
 
                                // count the total amount of players and total amount of teams
+                               t_players = 0;
+                               t_teams = 0;
                                FOR_EACH_PLAYER(tmp_player)
                                {
                                        CheckAllowedTeams(tmp_player);
@@ -1347,7 +1351,7 @@ void GameCommand_stuffto(float request, float argc)
                {
                        if(argv(2))
                        {
-                               entity client = GetIndexedEntity(argc, 1));
+                               entity client = GetIndexedEntity(argc, 1);
                                float accepted = VerifyClientEntity(client, TRUE, FALSE);
                                
                                if(accepted > 0)
@@ -1421,7 +1425,6 @@ void GameCommand_trace(float request, float argc)
                                                        {
                                                                rint(42); // do an engine breakpoint on VM_rint so you can get the trace that errnoeously returns startsolid
                                                                tracebox(start, PL_MIN, PL_MAX, end, MOVE_NOMONSTERS, world);
-                                                               tracebox(p, PL_MIN, PL_MAX, q, MOVE_NOMONSTERS, world);
 
                                                                if(trace_startsolid)
                                                                {
@@ -1657,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") \
@@ -1803,4 +1806,4 @@ void GameCommand(string command)
        print(((command != "") ? strcat("Unknown server command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try sv_cmd help.\n");
        
        return;
-}
\ No newline at end of file
+}