]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/sv_cmd.qc
Merge branch 'master' into Mario/notifications
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / sv_cmd.qc
index 694b157f77d34f77d3c8ed5ed1d4acddca387803..27ed6b8694e16ce8406b98b76cb7d95f020a19f7 100644 (file)
@@ -157,9 +157,6 @@ void GameCommand_mobbutcher(float request)
                                ++removed_count;
                        }
 
-                       FOR_EACH_PLAYER(head)
-                               head.monstercount = 0;
-
                        monsters_total = 0; // reset stats?
                        monsters_killed = 0;
 
@@ -216,6 +213,8 @@ void GameCommand_allspec(float request, float argc)
                        FOR_EACH_REALPLAYER(client)
                        {
                                self = client;
+                               if(self.caplayer)
+                                       self.caplayer = 0;
                                PutObserverInServer();
                                ++i;
                        }
@@ -479,14 +478,11 @@ void GameCommand_cointoss(float request, float argc)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       entity client;
-                       string result1 = (argv(2) ? strcat("^7", argv(1), "^3!\n") : "^1HEADS^3!\n");
-                       string result2 = (argv(2) ? strcat("^7", argv(2), "^3!\n") : "^4TAILS^3!\n");
+                       string result1 = (argv(2) ? strcat("^7", argv(1)) : "^1HEADS");
+                       string result2 = (argv(2) ? strcat("^7", argv(2)) : "^4TAILS");
                        string choice = ((random() > 0.5) ? result1 : result2);
-
-                       FOR_EACH_CLIENT(client)
-                               centerprint(client, strcat("^3Throwing coin... Result: ", choice));
-                       bprint(strcat("^3Throwing coin... Result: ", choice));
+                       
+                       Send_Notification(NOTIF_ALL, world, MSG_MULTI, MULTI_COINTOSS, choice);
                        return;
                }
 
@@ -1048,6 +1044,8 @@ void GameCommand_moveplayer(float request, float argc)
                                                if(!IS_SPEC(client) && !IS_OBSERVER(client))
                                                {
                                                        self = client;
+                                                       if(self.caplayer)
+                                                               self.caplayer = 0;
                                                        PutObserverInServer();
 
                                                        successful = strcat(successful, (successful ? ", " : ""), client.netname);
@@ -1153,9 +1151,10 @@ void GameCommand_nospectators(float request)
                {
                        blockSpectators = 1;
                        entity plr;
-                       FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
+                       FOR_EACH_REALCLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
                        {
                                if(IS_SPEC(plr) || IS_OBSERVER(plr))
+                               if(!plr.caplayer)
                                {
                                        plr.spectatortime = time;
                                        Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);