]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Switch to 3rd person mode camera for a moment when changing spectated player so to...
authorterencehill <piuntn@gmail.com>
Wed, 19 Sep 2018 22:10:20 +0000 (00:10 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 19 Sep 2018 22:10:20 +0000 (00:10 +0200)
qcsrc/client/autocvars.qh
qcsrc/client/defs.qh
qcsrc/client/main.qc
qcsrc/client/view.qc
xonotic-client.cfg

index 9c63f431267b47977c5303182ca9600f22008c95..06544187023cd8100e6f0d65e79dcde946989935 100644 (file)
@@ -411,6 +411,7 @@ float autocvar_cl_hitsound_min_pitch = 0.75;
 float autocvar_cl_hitsound_max_pitch = 1.5;
 float autocvar_cl_hitsound_nom_damage = 25;
 float autocvar_cl_hitsound_antispam_time;
+int autocvar_cl_eventchase_spectated_change = 1;
 int autocvar_cl_eventchase_death = 1;
 float autocvar_cl_eventchase_distance = 140;
 bool autocvar_cl_eventchase_frozen = false;
index 22cbc1a2df32b072905fa8ce9caee5de4f256dc4..5204e8f36dbcd09f54912bab92b453094914e01c 100644 (file)
@@ -77,6 +77,7 @@ float nb_pb_period;
 // 0 - playing
 // >0 - id of spectated player
 float spectatee_status;
+float spectatee_status_changed_time;
 
 // short mapname
 string shortmapname;
index 6844b1e078d7ad30380aae9913c1301832a5bc1d..955cfa7ff3ebc4b5d304ee3d6ff5a56d5ad623d8 100644 (file)
@@ -528,6 +528,7 @@ NET_HANDLE(ENT_CLIENT_CLIENTDATA, bool isnew)
                race_laptime = 0;
                race_checkpointtime = 0;
                hud_dynamic_shake_factor = -1;
+               spectatee_status_changed_time = time;
        }
        if (autocvar_hud_panel_healtharmor_progressbar_gfx)
        {
index ff9b47cbcdaa97fb2c7d735bc96167d09b02298b..9e7ecb67cd6fe1a5a2944a32a98ed1ec423f0a3a 100644 (file)
@@ -827,6 +827,9 @@ bool WantEventchase(entity this)
                        }
                        else return true;
                }
+               if (spectatee_status > 0 && autocvar_cl_eventchase_spectated_change
+                       && time <= spectatee_status_changed_time + 0.5)
+                       return true;
        }
        return false;
 }
index af69bbb2145677c5b05116f215f9ec6c9f44d787..ed81e0fb558ebb17c1645912208ab96e1f161e8b 100644 (file)
@@ -197,6 +197,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_spectated_change 1 "camera goes into 3rd person mode for a moment when changing spectated player"
 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_frozen 0 "camera goes into 3rd person mode when the player is frozen"
 seta cl_eventchase_nexball 1 "camera goes into 3rd person mode when in nexball game-mode"