]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
A few simple optimizations
authorterencehill <piuntn@gmail.com>
Fri, 5 Dec 2014 23:02:41 +0000 (00:02 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 5 Dec 2014 23:02:41 +0000 (00:02 +0100)
qcsrc/client/View.qc
qcsrc/client/shownames.qc
qcsrc/server/cl_physics.qc

index 166ea07f0903e287d9785c21fe3a443d0087f03e..16078d82894a46223f5f0e7da7fa61f49d164077 100644 (file)
@@ -162,13 +162,13 @@ vector GetCurrentFov(float fov)
        else
                setsensitivityscale(1);
 
-       makevectors(view_angles);
-
        if(autocvar_cl_velocityzoom && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too
        {
                if(intermission) { curspeed = 0; }
                else
                {
+
+                       makevectors(view_angles);
                        v = pmove_vel;
                        if(csqcplayer)
                                v = csqcplayer.velocity;
index 5deba45c41efe5b66636d4fdd5b65ebfb64c1111..3c89f312b0eb4c3dd4c1634edefa97ad4a89739f 100644 (file)
@@ -22,8 +22,6 @@ void Draw_ShowNames(entity ent)
                if(!(autocvar_hud_shownames_self && autocvar_chase_active))
                        return;
 
-       makevectors(view_angles);
-
        if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies))
        {
                ent.origin_z += autocvar_hud_shownames_offset;
index 14747fa99aabe535d9074e7e03ae6391adcebf80..6e48b8f0b129df7b5537971618e121aff8a66549 100644 (file)
@@ -1091,12 +1091,11 @@ void SV_PlayerPhysics()
                else
                        fz = bound(0, 1 + self.velocity_z / autocvar_g_jetpack_maxspeed_up, 1);
 
-               float fvel;
-               fvel = vlen(wishvel);
                wishvel_x *= fxy;
                wishvel_y *= fxy;
                wishvel_z = (wishvel_z - autocvar_sv_gravity) * fz + autocvar_sv_gravity;
 
+               float fvel;
                fvel = min(1, vlen(wishvel) / best);
                if(autocvar_g_jetpack_fuel && !(self.items & IT_UNLIMITED_WEAPON_AMMO))
                        f = min(1, self.ammo_fuel / (autocvar_g_jetpack_fuel * frametime * fvel));