]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
cl_eventchase_death 2 to active the effect only when the corpse doesn't move anymore
authorterencehill <piuntn@gmail.com>
Sun, 14 Dec 2014 21:20:25 +0000 (22:20 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 14 Dec 2014 21:20:25 +0000 (22:20 +0100)
defaultXonotic.cfg
qcsrc/client/View.qc

index 9f957ce07835691e8f7787680fd771bdf60bff40..95837f6d406e8ff87613954e37d1f6a0f0abc6f9 100644 (file)
@@ -226,7 +226,7 @@ seta cl_hitsound_min_pitch 0.75 "minimum pitch of hit sound"
 seta cl_hitsound_max_pitch 1.5 "maximum pitch of hit sound"
 seta cl_hitsound_nom_damage 25 "damage amount at which hitsound bases pitch off"
 
-seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead"
+seta cl_eventchase_death 1 "camera goes into 3rd person mode when the player is dead; set to 2 to active the effect only when the corpse doesn't move anymore"
 seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"
 seta cl_eventchase_distance 140 "final camera distance"
 seta cl_eventchase_speed 1.3 "how fast the camera slides back, 0 is instant"
index ffdd89c97faa4cb0c72c64fdb4b91e94d256b49c..c8eb49a5f1568a3944c825782be178a8d765abc8 100644 (file)
@@ -394,6 +394,7 @@ float contentavgalpha, liquidalpha_prev;
 vector liquidcolor_prev;
 
 float eventchase_current_distance;
+float eventchase_running;
 float WantEventchase()
 {
        if(autocvar_cl_orthoview)
@@ -402,10 +403,18 @@ float WantEventchase()
                return TRUE;
        if(spectatee_status >= 0)
        {
-               if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
-                       return TRUE;
                if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO)))
                        return TRUE;
+               if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
+               {
+                       if(autocvar_cl_eventchase_death == 2)
+                       {
+                               // don't stop eventchase once it's started (even if velocity changes afterwards)
+                               if(self.velocity == '0 0 0' || eventchase_running)
+                                       return TRUE;
+                       }
+                       else return TRUE;
+               }
        }
        return FALSE;
 }
@@ -512,6 +521,8 @@ void CSQC_UpdateView(float w, float h)
        {
                if(WantEventchase())
                {
+                       eventchase_running = TRUE;
+
                        // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.)
                        vector current_view_origin = (csqcplayer ? csqcplayer.origin : pmove_org);
 
@@ -552,6 +563,7 @@ void CSQC_UpdateView(float w, float h)
                }
                else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code
                {
+                       eventchase_running = FALSE;
                        cvar_set("chase_active", "0");
                        eventchase_current_distance = 0; // start from 0 next time
                }