Fix CBaseEntity::SetMass

This commit is contained in:
samisalreadytaken 2020-08-31 17:27:54 +03:00
parent 8672b7bb3f
commit d13f2a3e71

View File

@ -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)