From: terencehill Date: Fri, 16 Sep 2016 16:35:28 +0000 (+0200) Subject: When a round ends block players and switch to 3rd person view X-Git-Tag: xonotic-v0.8.2~389^2~5 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=52c2ac211c688794caa63ff56ceb7c817d9a55a3;p=xonotic%2Fxonotic-data.pk3dir.git When a round ends block players and switch to 3rd person view --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 3134a24ed..1e6103891 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -742,7 +742,7 @@ bool WantEventchase(entity this) { if(autocvar_cl_orthoview) return false; - if(intermission) + if(STAT(GAMEOVER) || intermission) return true; if(this.viewloc) return true; @@ -935,7 +935,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() ) { diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index d6aa068ea..252c0fdec 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -63,9 +63,10 @@ REGISTER_STAT(WEAPON_NEXTTHINK, float) #ifdef SVQC SPECTATE_COPYFIELD(_STAT(WEAPON_NEXTTHINK)) float W_WeaponRateFactor(entity this); +float gameover; #endif REGISTER_STAT(WEAPONRATEFACTOR, float, W_WeaponRateFactor(this)) - +REGISTER_STAT(GAMEOVER, int, gameover) REGISTER_STAT(GAMESTARTTIME, float) REGISTER_STAT(STRENGTH_FINISHED, float) REGISTER_STAT(INVINCIBLE_FINISHED, float) diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index b03496890..8b1726a0a 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -129,7 +129,6 @@ const int W_TICSPERFRAME = 2; void weapon_defaultspawnfunc(entity this, Weapon e); -float gameover; float intermission_running; float intermission_exittime; float alreadychangedlevel; diff --git a/qcsrc/server/round_handler.qc b/qcsrc/server/round_handler.qc index 3b11c5f9b..d060d2cca 100644 --- a/qcsrc/server/round_handler.qc +++ b/qcsrc/server/round_handler.qc @@ -12,6 +12,9 @@ void round_handler_Think(entity this) } if (gameover) + gameover = false; + + if (intermission_running) { round_handler_Reset(0); round_handler_Remove(); @@ -55,6 +58,7 @@ void round_handler_Think(entity this) // schedule a new round this.wait = true; this.nextthink = time + this.delay; + gameover = true; } else {