From: terencehill Date: Fri, 16 Sep 2022 10:58:01 +0000 (+0200) Subject: Smooth v_deathtiltangle effect; don't apply v_deathtiltangle if cl_eventchase_death... X-Git-Tag: xonotic-v0.8.6~361 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=3389f6aa909c6a1d591a9622bb85e05b45b036c2 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 --- 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;