]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Strip out old g_balance_weaponswitchdelay cvar usage
authorSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 07:57:13 +0000 (03:57 -0400)
committerSamual Lenks <samual@xonotic.org>
Tue, 14 May 2013 07:57:13 +0000 (03:57 -0400)
crosshairs.cfg
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/main.qh
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc

index e37584bdf5c194c0229765edf283dbf4b787370e..e02e7c2e2ebe50949338d03c0794e6187a174813 100644 (file)
@@ -17,7 +17,7 @@ seta crosshair_dot_color "1 0 0"
 seta crosshair_dot_color_custom 1 "use a custom color for the crosshair dot"
 
 // smooth transitions for crosshair changes
-seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time"
+seta crosshair_effect_time 0.4 "how fast (in seconds) some crosshair effects should take place, 0 = instant"
 seta crosshair_effect_scalefade 1 "use scaling and fading for crosshair effects"
 
 // item pickup animation settings
index f60ad9765f44dd684658e5da923267d961582fc7..edb4105eed3f2badb0670a894e7a303972b72465 100644 (file)
@@ -1020,8 +1020,6 @@ void Ent_Init()
 
        armorblockpercent = ReadByte() / 255.0;
 
-       g_weaponswitchdelay = ReadByte() / 255.0;
-
        g_balance_grenadelauncher_bouncefactor = ReadCoord();
        g_balance_grenadelauncher_bouncestop = ReadCoord();
        g_balance_electro_secondary_bouncefactor = ReadCoord();
index b2e9c03e0ea5659da6b93b5f1c41b0592283e864..08c247f4e2ddd3a418f6a78798b69ba02f7f1c91 100644 (file)
@@ -1294,9 +1294,7 @@ void CSQC_UpdateView(float w, float h)
                        if(shottype == SHOTTYPE_HITTEAM)
                                wcross_scale /= autocvar_crosshair_hittest; // is not queried if hittest is 0
 
-                       f = autocvar_crosshair_effect_speed;
-                       if(f < 0)
-                               f *= -2 * g_weaponswitchdelay; // anim starts when weapon has been lowered and new weapon comes up
+                       f = fabs(autocvar_crosshair_effect_time);
                        if(wcross_scale != wcross_scale_goal_prev || wcross_alpha != wcross_alpha_goal_prev || wcross_color != wcross_color_goal_prev)
                        {
                                wcross_changedonetime = time + f;
@@ -1420,9 +1418,9 @@ void CSQC_UpdateView(float w, float h)
                                        }
 
                                        // if in weapon switch animation, fade ring out/in
-                                       if(g_weaponswitchdelay > 0)
+                                       if(fabs(autocvar_crosshair_effect_time) > 0)
                                        {
-                                               f = (time - wcross_name_changestarttime) / g_weaponswitchdelay;
+                                               f = (time - wcross_name_changestarttime) / wcross_changedonetime;
                                                if(f > 0 && f < 2)
                                                        ring_alpha *= fabs(1 - f);
                                        }
index 16714460b581112b40e7458066b1a22c169b176b..af7008150eadf03b39bebccad78c018f5aaadbdc 100644 (file)
@@ -105,7 +105,7 @@ string autocvar_crosshair_dot_color;
 var float autocvar_crosshair_dot_color_custom = 1;
 float autocvar_crosshair_dot_size;
 float autocvar_crosshair_effect_scalefade;
-float autocvar_crosshair_effect_speed;
+var float autocvar_crosshair_effect_time = 0.2;
 var float autocvar_crosshair_enabled = 1;
 float autocvar_crosshair_hitindication;
 string autocvar_crosshair_hitindication_color;
index 8369a5ff20bc9ce399d0eef7c1a35d1063b4d8a9..10a3b165c89d6ba1cf5c8ea8146e8f7b867b625b 100644 (file)
@@ -127,7 +127,6 @@ void centerprint_generic(float new_id, string strMessage, float duration, float
 #define ALPHA_MIN_VISIBLE 0.003
 
 float armorblockpercent;
-float g_weaponswitchdelay;
 
 //hooks
 float calledhooks;
index fe96bc0357d6e63ffe6e3392042d0f7ec917fe1d..e6a242a70454a714e47bfbeeb151a875b45789d4 100644 (file)
@@ -509,8 +509,6 @@ float autocvar_g_balance_nex_secondary_damagefalloff_maxdist;
 float autocvar_g_balance_nex_secondary_damagefalloff_mindist;
 float autocvar_g_balance_nex_secondary_force;
 float autocvar_g_balance_nex_secondary_refire;
-noref float autocvar_g_balance_nex_switchdelay_drop;
-noref float autocvar_g_balance_nex_switchdelay_raise;
 float autocvar_g_balance_nex_reload_ammo;
 float autocvar_g_balance_nex_reload_time;
 float autocvar_g_balance_nexball_primary_animtime;
@@ -690,7 +688,6 @@ float autocvar_g_balance_uzi_sustained_refire;
 float autocvar_g_balance_uzi_sustained_spread;
 float autocvar_g_balance_uzi_reload_ammo;
 float autocvar_g_balance_uzi_reload_time;
-float autocvar_g_balance_weaponswitchdelay;
 float autocvar_g_ballistics_density_corpse;
 float autocvar_g_ballistics_density_player;
 float autocvar_g_ballistics_materialconstant;
index 9239a829202a7b910d8e9a851bee4f01e1f8c583..e3731943f5a306fc413a73cafb37d6b0b9fa9aec 100644 (file)
@@ -629,7 +629,6 @@ float ClientInit_SendEntity(entity to, float sf)
        else
                WriteString(MSG_ENTITY, "");
        WriteByte(MSG_ENTITY, self.count * 255.0); // g_balance_armor_blockpercent
-       WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay
        WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_bouncefactor
        WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_bouncestop
        WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
@@ -652,11 +651,6 @@ void ClientInit_CheckUpdate()
                self.count = autocvar_g_balance_armor_blockpercent;
                self.SendFlags |= 1;
        }
-       if(self.cnt != autocvar_g_balance_weaponswitchdelay)
-       {
-               self.cnt = autocvar_g_balance_weaponswitchdelay;
-               self.SendFlags |= 1;
-       }
        if(self.bouncefactor != autocvar_g_balance_grenadelauncher_bouncefactor)
        {
                self.bouncefactor = autocvar_g_balance_grenadelauncher_bouncefactor;