From 3389f6aa909c6a1d591a9622bb85e05b45b036c2 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 16 Sep 2022 12:58:01 +0200 Subject: [PATCH] Smooth v_deathtiltangle effect; don't apply v_deathtiltangle if cl_eventchase_death is 2; avoid executing cl_rollangle code if cl_rollangle is 0 --- qcsrc/lib/csqcmodel/cl_player.qc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 5b35bfa4e..5521feae1 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -269,7 +269,11 @@ void CSQCPlayer_ApplyDeathTilt(entity this) { if(!this.csqcmodel_isdead || !autocvar_v_deathtilt) return; - view_angles.z = autocvar_v_deathtiltangle; + // incompatible with cl_eventchase_death 2 because tilting is applied while the corpse is + // in the air and immediately turned off when it touches the ground + if (autocvar_cl_eventchase_death == 2 && this.csqcmodel_isdead) + return; + view_angles.z += min((time - this.death_time) * 8, 1) * autocvar_v_deathtiltangle; } float autocvar_v_idlescale; @@ -417,6 +421,8 @@ float autocvar_cl_rollangle; float autocvar_cl_rollspeed; float CSQCPlayer_CalcRoll(entity this) { + if (!autocvar_cl_rollangle) return 0; + makevectors(view_angles); float side = (this.velocity * v_right); float sign = (side < 0) ? -1 : 1; -- 2.39.2