X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;ds=inline;f=qcsrc%2Fserver%2Fcl_client.qc;h=7c2f90407722c786570f7262bd056f57aa668377;hb=9971f28f796f51a9c05702a9d4ae382e4e4f0796;hp=fac1c0e57111079104c270b3f7201c0d2ae66694;hpb=9abf8f085ddcfdc7ed88965c6edfa812928c48c8;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index fac1c0e57..7c2f90407 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -2,15 +2,8 @@ void race_send_recordtime(float msg); void race_SendRankings(float pos, float prevpos, float del, float msg); void send_CSQC_teamnagger() { - WriteByte(0, SVC_TEMPENTITY); - WriteByte(0, TE_CSQC_TEAMNAGGER); -} - -void send_CSQC_cr_maxbullets(entity e) { - msg_entity = e; - WriteByte(MSG_ONE, SVC_TEMPENTITY); - WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS); - WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity); + WriteByte(MSG_BROADCAST, SVC_TEMPENTITY); + WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER); } void Announce(string snd) { @@ -724,15 +717,6 @@ void PutObserverInServer (void) self.frags = FRAGS_SPECTATOR; } -float RestrictSkin(float s) -{ - if(!teams_matter) - return s; - if(s == 6) - return 6; - return mod(s, 3); -} - void FixPlayermodel() { local string defaultmodel; @@ -794,7 +778,7 @@ void FixPlayermodel() } oldskin = self.skinindex; - self.skinindex = RestrictSkin(stof(self.playerskin)); + self.skinindex = stof(self.playerskin); } if(chmdl || oldskin != self.skinindex) @@ -1123,6 +1107,7 @@ float ClientInit_SendEntity(entity to, float sf) WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not + WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_magazinecapacity); // rifle max bullets return TRUE; } @@ -1244,18 +1229,16 @@ void ClientKill_Now_TeamChange() void ClientKill_Now() { + remove(self.killindicator); + self.killindicator = world; + if(self.killindicator_teamchange) ClientKill_Now_TeamChange(); // in any case: Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0'); - if(self.killindicator) - { - dprint("Cleaned up after a leaked kill indicator.\n"); - remove(self.killindicator); - self.killindicator = world; - } + // now I am sure the player IS dead } void KillIndicator_Think() { @@ -1272,7 +1255,7 @@ void KillIndicator_Think() ClientKill_Now(); // no oldself needed return; } - else if(g_cts) + else if(g_cts && self.health == 1) // health == 1 means that it's silent { self.nextthink = time + 1; self.cnt -= 1; @@ -1311,6 +1294,15 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 if(g_race_qualifying || g_cts) killtime = 0; + if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill + { + remove(self.killindicator); + self.killindicator = world; + + ClientKill_Now(); // allow instant kill in this case + return; + } + self.killindicator_teamchange = targetteam; if(!self.killindicator) @@ -1336,7 +1328,7 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 self.killindicator.nextthink = time + (self.lip) * 0.05; self.killindicator.cnt = ceil(killtime); self.killindicator.count = bound(0, ceil(killtime), 10); - sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n")); + //sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n")); for(e = world; (e = find(e, classname, "body")) != world; ) { @@ -1381,13 +1373,14 @@ void ClientKill (void) ClientKill_TeamChange(0); } -void CTS_ClientKill (entity e) // silent version of ClientKill +void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed { e.killindicator = spawn(); e.killindicator.owner = e; e.killindicator.think = KillIndicator_Think; e.killindicator.nextthink = time + (e.lip) * 0.05; e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay); + e.killindicator.health = 1; // this is used to indicate that it should be silent e.lip = 0; } @@ -1501,6 +1494,7 @@ Called when a client connects to the server string ColoredTeamName(float t); void DecodeLevelParms (void); //void dom_player_join_team(entity pl); +void set_dom_state(void); void ClientConnect (void) { float t; @@ -1742,7 +1736,8 @@ void ClientConnect (void) else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca send_CSQC_teamnagger(); - send_CSQC_cr_maxbullets(self); + if (g_domination) + set_dom_state(); CheatInitClient();