]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_client.qc
Do the ammo maths at the beginning again, more correct and safe
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_client.qc
index cb2d2ed3dea2cecefbf54d40905f90ad30954dca..12e2f1327940cbba964693f59f28459e9df917f3 100644 (file)
@@ -889,6 +889,16 @@ void PutClientInServer (void)
                        self.nex_charge = autocvar_g_balance_nex_charge_start;
                }
 
+               // all weapons must be fully loaded the first time we pick them up, so set their load to maximum at respawn
+               self.shotgun_load = autocvar_g_balance_shotgun_reload_ammo;
+               self.sniperrifle_load = autocvar_g_balance_sniperrifle_reload_ammo;
+               self.uzi_load = autocvar_g_balance_uzi_reload_ammo;
+               self.grenadelauncher_load = autocvar_g_balance_grenadelauncher_reload_ammo;
+               self.minelayer_load = autocvar_g_balance_minelayer_reload_ammo;
+               self.electro_load = autocvar_g_balance_electro_reload_ammo;
+               self.crylink_load = autocvar_g_balance_crylink_reload_ammo;
+               self.hlac_load = autocvar_g_balance_hlac_reload_ammo;
+
                if(inWarmupStage)
                {
                        self.ammo_shells = warmup_start_ammo_shells;
@@ -1107,7 +1117,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_sniperrifle_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_sniperrifle_magazinecapacity); // rifle max bullets
+       WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
        return TRUE;
 }
 
@@ -1365,7 +1375,7 @@ void ClientKill (void)
        {
                // do nothing
        }
-    else if(g_freezetag && self.freezetag_frozen == 1)
+    else if(self.freezetag_frozen)
     {
         // do nothing
     }
@@ -2040,7 +2050,7 @@ void player_powerups (void)
                self.modelflags &~= MF_ROCKET;
        }
 
-       self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+       self.effects &~= (EF_DIMLIGHT | EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
        if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
                return;