From: terencehill Date: Fri, 5 Dec 2014 23:02:41 +0000 (+0100) Subject: A few simple optimizations X-Git-Tag: xonotic-v0.8.0~116^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=88a86a8dd89cffa92d150ea0c3283cee2b5d1980;p=xonotic%2Fxonotic-data.pk3dir.git A few simple optimizations --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 166ea07f0..16078d828 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -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; diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 5deba45c4..3c89f312b 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -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; diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index 14747fa99..6e48b8f0b 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -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));