]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Make sure a vote is actually running before trying to count it when a client leaves
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index d211e0f384347a562839778a2a91e7870820aee5..de2603437e253f69e2c2322706a55ba846f8c92f 100644 (file)
@@ -1078,7 +1078,7 @@ void ClientConnect()
 
        this.netname_previous = strzone(this.netname);
 
-       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, (teamplay ? APP_TEAM_ENT_4(this, INFO_JOIN_CONNECT_TEAM_) : INFO_JOIN_CONNECT), this.netname);
+       Send_Notification(NOTIF_ALL, NULL, MSG_INFO, ((teamplay && IS_PLAYER(this)) ? APP_TEAM_ENT_4(this, INFO_JOIN_CONNECT_TEAM_) : INFO_JOIN_CONNECT), this.netname);
 
        stuffcmd(this, clientstuff, "\n");
        stuffcmd(this, "cl_particles_reloadeffects\n"); // TODO do we still need this?
@@ -1244,6 +1244,9 @@ void ClientDisconnect ()
 
        self.playerid = 0;
        ReadyCount();
+       if(vote_called)
+       if(IS_REAL_CLIENT(self))
+               VoteCount(false);
 
        // free cvars
        GetCvars(-1);
@@ -1330,7 +1333,7 @@ void respawn()
                        SUB_SetFade (self, time + autocvar_g_respawn_ghosts_maxtime / 2 + random () * (autocvar_g_respawn_ghosts_maxtime - autocvar_g_respawn_ghosts_maxtime / 2), 1.5);
        }
 
-       CopyBody(1);
+       CopyBody(self, 1);
 
        self.effects |= EF_NODRAW; // prevent another CopyBody
        PutClientInServer();
@@ -1827,7 +1830,7 @@ void LeaveSpectatorMode()
 
                        PutClientInServer();
 
-                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_JOIN_PLAY, self.netname); }
+                       if(IS_PLAYER(self)) { Send_Notification(NOTIF_ALL, world, MSG_INFO, ((teamplay && this.team != -1) ? APP_TEAM_ENT_4(this, INFO_JOIN_PLAY_TEAM_) : INFO_JOIN_PLAY), self.netname); }
                }
                else
                        stuffcmd(self, "menu_showteamselect\n");