From ecfecb7987105113a9b1d0fd1f5590cdfbdddbb8 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 2 May 2020 11:07:14 +0200 Subject: [PATCH] Fix height of csqcplayer when dead, previously it was wrongly applied the ducked height since the bloodloss code wrongly set do_crouch to true when dead --- qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc | 4 ++-- qcsrc/lib/csqcmodel/cl_player.qc | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc index 2a0ebec45..41ceaa91f 100644 --- a/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc +++ b/qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc @@ -57,12 +57,12 @@ MUTATOR_HOOKFUNCTION(bloodloss, BuildMutatorsPrettyString) #ifdef CSQC MUTATOR_HOOKFUNCTION(bloodloss, PlayerCanCrouch) { - if(STAT(HEALTH) <= STAT(BLOODLOSS)) + if(STAT(HEALTH) > 0 && STAT(HEALTH) <= STAT(BLOODLOSS)) M_ARGV(1, bool) = true; // do_crouch } MUTATOR_HOOKFUNCTION(bloodloss, PlayerJump) { - if(STAT(HEALTH) <= STAT(BLOODLOSS)) + if(STAT(HEALTH) > 0 && STAT(HEALTH) <= STAT(BLOODLOSS)) return true; } #endif diff --git a/qcsrc/lib/csqcmodel/cl_player.qc b/qcsrc/lib/csqcmodel/cl_player.qc index 19a6c0461..a5610b3de 100644 --- a/qcsrc/lib/csqcmodel/cl_player.qc +++ b/qcsrc/lib/csqcmodel/cl_player.qc @@ -108,6 +108,8 @@ void CSQCPlayer_SetMinsMaxs(entity this) { this.mins = PHYS_PL_MIN(this); this.maxs = PHYS_PL_MAX(this); + if (IS_DEAD(this)) + this.maxs.z = 5; this.view_ofs = PHYS_PL_VIEWOFS(this); } } -- 2.39.2