From d13f2a3e7149193a65bf7e65917aec48ca932906 Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Mon, 31 Aug 2020 17:27:54 +0300 Subject: [PATCH] Fix CBaseEntity::SetMass --- sp/src/game/server/baseentity.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sp/src/game/server/baseentity.h b/sp/src/game/server/baseentity.h index 740dc762..71b9a45b 100644 --- a/sp/src/game/server/baseentity.h +++ b/sp/src/game/server/baseentity.h @@ -2424,14 +2424,13 @@ inline float CBaseEntity::GetMass() else { Warning("Tried to call GetMass() on %s but it has no physics.\n", GetDebugName()); - return -1; + return 0; } } inline void CBaseEntity::SetMass(float mass) { - mass = MAX(0, mass); - Assert(mass > 0); + mass = clamp(mass, VPHYSICS_MIN_MASS, VPHYSICS_MAX_MASS); IPhysicsObject *vPhys = VPhysicsGetObject(); if (vPhys)