]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
experimental change: sort impulse weapon order by weapon priority too
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index 068912d6589f0f94df85fcb6f02d280a821aedbc..955c0a45d2e0660d002343905515cf34f67b6647 100644 (file)
@@ -6,18 +6,6 @@ void send_CSQC_teamnagger() {
        WriteByte(0, TE_CSQC_TEAMNAGGER);
 }
 
-void send_CSQC_nexvelocity(entity e) {
-       msg_entity = e;
-       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-       WriteByte(MSG_ONE, TE_CSQC_NEX_VELOCITY);
-       WriteByte(MSG_ONE, bound(0, fabs(cvar("g_balance_nex_velocitydependent_halflife")), 1));
-       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_minspeed"));
-       WriteShort(MSG_ONE, cvar("g_balance_nex_velocitydependent_maxspeed"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_velocitydependent_falloff_rate"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge"));
-       WriteByte(MSG_ONE, cvar("g_balance_nex_secondary_charge_rate"));
-}
-
 void send_CSQC_cr_maxbullets(entity e) {
        msg_entity = e;
        WriteByte(MSG_ONE, SVC_TEMPENTITY);
@@ -901,6 +889,8 @@ void PutClientInServer (void)
                        self.effects = 0;
                self.air_finished = time + 12;
                self.dmg = 2;
+               if(cvar("g_balance_nex_charge"))
+                       self.nex_charge = cvar("g_balance_nex_charge_start");
 
                if(inWarmupStage)
                {
@@ -1315,7 +1305,12 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto
 
 void ClientKill (void)
 {
-       ClientKill_TeamChange(0);
+       if((g_arena || g_ca) && ((champion && champion.classname == "player" && player_count > 1) || player_count == 1)) // don't allow a kill in this case either
+       {
+               // do nothing
+       }
+       else
+               ClientKill_TeamChange(0);
 }
 
 void DoTeamChange(float destteam)
@@ -1607,7 +1602,6 @@ void ClientConnect (void)
        else if(cvar("sv_teamnagger") && !(cvar("bot_vs_human") && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
                send_CSQC_teamnagger();
 
-       send_CSQC_nexvelocity(self);
        send_CSQC_cr_maxbullets(self);
 
        CheatInitClient();
@@ -1701,6 +1695,8 @@ void ClientDisconnect (void)
                strunzone(self.netname_previous);
        if(self.clientstatus)
                strunzone(self.clientstatus);
+       if(self.weaponorder_byimpulse)
+               strunzone(self.weaponorder_byimpulse);
 
        ClearPlayerSounds();