]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/view.qc
Merge branch 'martin-t/maxshotdist' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / view.qc
index a3bc0462e3ccc24970fce9a148a390db6dc8466f..2521548e15b0d1e4671c8029953cecfacb00ccae 100644 (file)
@@ -125,7 +125,6 @@ void calc_followmodel_ofs(entity view)
        float frac;
        vector gunorg = '0 0 0';
        static vector vel_average;
-       static vector gunorg_prev = '0 0 0';
        static vector gunorg_adjustment_highpass;
        static vector gunorg_adjustment_lowpass;
 
@@ -314,12 +313,9 @@ void viewmodel_draw(entity this)
        {
                static string name_last;
                string name = wep.mdl;
-               if(wep == WEP_TUBA)
-               {
-                       name = (this.tuba_instrument == 0) ? "tuba" :
-                          (this.tuba_instrument == 1) ? "akordeon" :
-                                                    "kleinbottle";
-               }
+               string newname = wep.wr_viewmodel(wep, this);
+               if(newname)
+                       name = newname;
                bool swap = name != name_last;
                // if (swap)
                {
@@ -657,7 +653,7 @@ float TrueAimCheck()
                        mv = MOVE_NORMAL;
                        if(zoomscript_caught)
                        {
-                               tracebox(view_origin, '0 0 0', '0 0 0', view_origin + view_forward * MAX_SHOT_DISTANCE, mv, ta);
+                               tracebox(view_origin, '0 0 0', '0 0 0', view_origin + view_forward * max_shot_distance, mv, ta);
                                return EnemyHitCheck();
                        }
                        break;
@@ -683,7 +679,7 @@ float TrueAimCheck()
 
        vecs = decompressShotOrigin(STAT(SHOTORG));
 
-       traceline(traceorigin, traceorigin + view_forward * MAX_SHOT_DISTANCE, mv, ta);
+       traceline(traceorigin, traceorigin + view_forward * max_shot_distance, mv, ta);
        trueaimpoint = trace_endpos;
 
        if(vdist((trueaimpoint - traceorigin), <, g_trueaim_minrange))
@@ -751,7 +747,7 @@ bool WantEventchase(entity this)
 {
        if(autocvar_cl_orthoview)
                return false;
-       if(intermission)
+       if(STAT(GAMEOVER) || intermission)
                return true;
        if(this.viewloc)
                return true;
@@ -944,7 +940,7 @@ void HUD_Crosshair(entity this)
 {
        float f, i, j;
        vector v;
-       if(!scoreboard_active && !camera_active && intermission != 2 &&
+       if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAMEOVER) &&
                spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
                !HUD_MinigameMenu_IsOpened() )
        {
@@ -976,7 +972,7 @@ void HUD_Crosshair(entity this)
                float shottype;
 
                // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
-               wcross_origin = project_3d_to_2d(view_origin + MAX_SHOT_DISTANCE * view_forward);
+               wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
                wcross_origin.z = 0;
                if(autocvar_crosshair_hittest)
                {
@@ -1752,8 +1748,8 @@ void CSQC_UpdateView(entity this, float w, float h)
        if(!postinit)
                PostInit();
 
-       if(intermission && !gameover_time)
-               gameover_time = time;
+       if(intermission && !intermission_time)
+               intermission_time = time;
 
        if(intermission && !isdemo() && !(calledhooks & HOOK_END))
        {