X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fclient%2Fview.qc;h=ff9b47cbcdaa97fb2c7d735bc96167d09b02298b;hp=4d355fb2a177fd5fe102c19ff5b7783381abf227;hb=8e5d376c49510049572c7c182ba8778c8a8f80dd;hpb=6c27fe90b0454df3dbf7b098bc554fcb5eaa75d0 diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 4d355fb2a..ff9b47cbc 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -48,6 +48,7 @@ #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOSHADOW | EF_SELECTABLE | EF_TELEPORT_BIT) float autocvar_cl_viewmodel_scale; +float autocvar_cl_viewmodel_alpha; bool autocvar_cl_bobmodel; float autocvar_cl_bobmodel_speed; @@ -297,12 +298,9 @@ void viewmodel_draw(entity this) if(!this.activeweapon || !autocvar_r_drawviewmodel) return; int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL; - float a = this.alpha; - static bool wasinvehicle; + float a = ((autocvar_cl_viewmodel_alpha) ? bound(-1, autocvar_cl_viewmodel_alpha, this.m_alpha) : this.m_alpha); bool invehicle = player_localentnum > maxclients; if (invehicle) a = -1; - else if (wasinvehicle) a = 1; - wasinvehicle = invehicle; Weapon wep = this.activeweapon; int c = entcs_GetClientColors(current_player); vector g = weaponentity_glowmod(wep, NULL, c, this); @@ -427,6 +425,10 @@ void Porto_Draw(entity this) vector pos = view_origin; vector dir = view_forward; + makevectors(((autocvar_chase_active) ? warpzone_save_view_angles : view_angles)); + pos += v_right * -wepent.movedir.y + + v_up * wepent.movedir.z; + if (wepent.angles_held_status) { makevectors(wepent.angles_held); @@ -491,9 +493,8 @@ vector GetCurrentFov(float fov) if(zoomfactor < 1 || zoomfactor > 30) zoomfactor = 2.5; zoomspeed = autocvar_cl_zoomspeed; - if(zoomspeed >= 0) - if(zoomspeed < 0.5 || zoomspeed > 16) - zoomspeed = 3.5; + if (zoomspeed >= 0 && (zoomspeed < 0.5 || zoomspeed > 16)) + zoomspeed = 3.5; zoomdir = button_zoom; @@ -526,7 +527,11 @@ vector GetCurrentFov(float fov) if(zoomdir) { zoomin_effect = 0; } - if(camera_active) + if (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2) + { + current_viewzoom = 1; + } + else if (camera_active) { current_viewzoom = min(1, current_viewzoom + drawframetime); } @@ -570,10 +575,10 @@ vector GetCurrentFov(float fov) if(autocvar_cl_velocityzoom_enabled && autocvar_cl_velocityzoom_type) // _type = 0 disables velocity zoom too { - if(intermission) { curspeed = 0; } + if (intermission || (spectatee_status > 0 && STAT(CAMERA_SPECTATOR) == 2)) + curspeed = 0; else { - makevectors(view_angles); v = pmove_vel; if(csqcplayer) @@ -1565,7 +1570,7 @@ int lasthud; float vh_notice_time; void CSQC_UpdateView(entity this, float w, float h) { - TC(int, w); TC(int, h); + TC(int, w); TC(int, h); entity e; float fov; float f;