Fix height of csqcplayer when dead, previously it was wrongly applied the ducked...
authorterencehill <piuntn@gmail.com>
Sat, 2 May 2020 09:07:14 +0000 (11:07 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 2 May 2020 09:07:14 +0000 (11:07 +0200)
qcsrc/common/mutators/mutator/bloodloss/bloodloss.qc
qcsrc/lib/csqcmodel/cl_player.qc

index 2a0ebec..41ceaa9 100644 (file)
@@ -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
index 19a6c04..a5610b3 100644 (file)
@@ -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);
        }
 }