From: Rudolf Polzer Date: Sat, 13 Aug 2011 12:07:51 +0000 (+0200) Subject: simplify the code, and get rid of some issues of it (using a freed entity) X-Git-Tag: xonotic-v0.5.0~148^2~12 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=936b469d3d9d0f843ed3bd82508698d479a489db;p=xonotic%2Fxonotic-data.pk3dir.git simplify the code, and get rid of some issues of it (using a freed entity) --- diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 6e2745cdb..a497f8c34 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1295,11 +1295,8 @@ void KillIndicator_Think() { if (gameover) { - if (self.owner.killindicator) - { - remove(self.owner.killindicator); - self.owner.killindicator = world; - } + self.owner.killindicator = world; + remove(self); return; } @@ -1352,14 +1349,7 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 entity e; if (gameover) - { - if (self.killindicator) - { - remove(self.killindicator); - self.killindicator = world; - } return; - } killtime = autocvar_g_balance_kill_delay; @@ -1459,67 +1449,6 @@ void CTS_ClientKill (entity e) // silent version of ClientKill, used when player e.lip = 0; } -void DoTeamChange(float destteam) -{ - float t, c0; - - if (gameover) - { - if (self.killindicator) - { - remove(self.killindicator); - self.killindicator = world; - } - return; - } - - if(!teamplay) - { - if(destteam >= 0) - SetPlayerColors(self, destteam); - return; - } - - if(self.classname == "player") - if(destteam == -1) - { - CheckAllowedTeams(self); - t = FindSmallestTeam(self, TRUE); - switch(self.team) - { - case COLOR_TEAM1: c0 = c1; break; - case COLOR_TEAM2: c0 = c2; break; - case COLOR_TEAM3: c0 = c3; break; - case COLOR_TEAM4: c0 = c4; break; - default: c0 = 999; - } - switch(t) - { - case 1: - if(c0 > c1) - destteam = COLOR_TEAM1; - break; - case 2: - if(c0 > c2) - destteam = COLOR_TEAM2; - break; - case 3: - if(c0 > c3) - destteam = COLOR_TEAM3; - break; - case 4: - if(c0 > c4) - destteam = COLOR_TEAM4; - break; - } - if(destteam == -1) - return; - } - if(destteam == self.team && destteam >= 0 && !self.killindicator) - return; - ClientKill_TeamChange(destteam); -} - void FixClientCvars(entity e) { // send prediction settings to the client