]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
WHY IS THIS FUCKING SHIT SO FUCKING STUPID??!?!?!
authorSamual Lenks <samual@xonotic.org>
Tue, 5 Mar 2013 04:30:18 +0000 (23:30 -0500)
committerSamual Lenks <samual@xonotic.org>
Tue, 5 Mar 2013 04:30:18 +0000 (23:30 -0500)
qcsrc/server/cl_client.qc
qcsrc/server/command/cmd.qc

index 001f048fbad0d2b701a1b56db06c0229355de7bd..356d444c0c8a46918d573da4b036756243c6b1ef 100644 (file)
@@ -2321,50 +2321,34 @@ void ShowRespawnCountdown()
        }
 }
 
-.float prevent_join_msgtime;
 void LeaveSpectatorMode()
 {
-       if(nJoinAllowed(self)) {
-               if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0) {
+       if(nJoinAllowed(self))
+       {
+               if(!teamplay || autocvar_g_campaign || autocvar_g_balance_teams || (self.wasplayer && autocvar_g_changeteam_banned) || self.team_forced > 0)
+               {
                        self.classname = "player";
 
                        if(autocvar_g_campaign || autocvar_g_balance_teams)
-                               JoinBestTeam(self, FALSE, TRUE);
+                               { JoinBestTeam(self, FALSE, TRUE); }
 
                        if(autocvar_g_campaign)
-                               campaign_bots_may_start = 1;
+                               { campaign_bots_may_start = 1; }
+                       else
+                               { Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD); }
 
+                       Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
+                       
                        PutClientInServer();
 
-                       if(self.classname == STR_PLAYER)
-                               Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname);
-
-                       if(!autocvar_g_campaign)
-                       //if (time < self.jointime + autocvar_welcome_message_time)
-                               Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_MOTD);
-
-                       if (self.prevent_join_msgtime)
-                       {
-                               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
-                               self.prevent_join_msgtime = 0;
-                       }
-
-                       return;
-               } else {
-                       if (g_ca && self.caplayer) {
-                       }       // do nothing
-                       else
-                               stuffcmd(self,"menu_showteamselect\n");
-                       return;
+                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname); }
                }
+               else if not(g_ca && self.caplayer) { stuffcmd(self, "menu_showteamselect\n"); }
        }
-       else {
-               //player may not join because of g_maxplayers is set
-               if (time - self.prevent_join_msgtime > 2)
-               {
-                       Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
-                       self.prevent_join_msgtime = time;
-               }
+       else
+       {
+               // Player may not join because g_maxplayers is set
+               Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_PREVENT_JOIN);
        }
 }
 
index 36567b4986af079bc7a7a9270afef42fe0f90ec0..ebe51ff10154b83329ddcc797dcb90573678534d 100644 (file)
@@ -152,7 +152,7 @@ void ClientCommand_join(float request)
                        {
                                if(self.classname != "player" && !lockteams && !g_arena)
                                {
-                                       if(nJoinAllowed(self)) 
+/*                                     if(nJoinAllowed(self)) 
                                        {
                                                if(g_ca) { self.caplayer = 1; }
                                                if(autocvar_g_campaign) { campaign_bots_may_start = 1; }
@@ -166,7 +166,8 @@ void ClientCommand_join(float request)
                                        {
                                                //player may not join because of g_maxplayers is set
                                                Send_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER, CENTER_JOIN_PREVENT);
-                                       }
+                                       }*/
+                                       LeaveSpectatorMode();
                                }
                        }
                        return; // never fall through to usage