const vector PL_CROUCH_MAX_CONST = '16 16 25';
const vector PL_CROUCH_MIN_CONST = '-16 -16 -24';
+const float PL_CORPSE_SCALE = 0.235; // average hitbox height is scaled by this when the player dies
+
// gametype vote flags
const int GTV_FORBIDDEN = 0; // Cannot be voted
const int GTV_AVAILABLE = 1; // Can be voted
{
this.mins = PHYS_PL_MIN(this);
this.maxs = PHYS_PL_MAX(this);
- if (IS_DEAD(this))
- this.maxs.z = 5;
+ if(IS_DEAD(this))
+ {
+ float h = ceil((this.mins.z + this.maxs.z) * PL_CORPSE_SCALE * 10) / 10;
+ this.maxs.z = max(h, this.mins.z + 1);
+ }
this.view_ofs = PHYS_PL_VIEWOFS(this);
}
}
{
// player's bbox gets resized now, instead of in the damage event that killed the player,
// once all the damage events of this frame have been processed with normal size
- this.maxs.z = 5;
+ float h = ceil((this.mins.z + this.maxs.z) * PL_CORPSE_SCALE * 10) / 10;
+ this.maxs.z = max(h, this.mins.z + 1);
setsize(this, this.mins, this.maxs);
}
DrownPlayer(this);