physics: fix a lot of problems

This commit is contained in:
nillerusr
2021-10-23 14:41:59 +03:00
parent cb04a1e451
commit dc2be1dcb4
31 changed files with 104 additions and 54 deletions
+14 -2
View File
@@ -174,7 +174,13 @@ void CVPhysicsParse::ParseSolid( solid_t *pSolid, IVPhysicsKeyHandler *unknownKe
}
else if ( !Q_stricmp( key, "inertia" ) )
{
pSolid->params.inertia = atof(value);
float inertia = atof(value);
if( inertia > 1e14f )
pSolid->params.inertia = 1e14f;
else if( inertia <= 0 )
pSolid->params.inertia = 1.f;
else
pSolid->params.inertia = inertia;
}
else if ( !Q_stricmp( key, "damping" ) )
{
@@ -468,7 +474,13 @@ void CVPhysicsParse::ParseVehicleWheel( vehicle_wheelparams_t &wheel )
}
else if ( !Q_stricmp( key, "inertia" ) )
{
wheel.inertia = atof( value );
float inertia = atof(value);
if( inertia > 1e14f )
wheel.inertia = 1e14f;
else if( inertia <= 0 )
wheel.inertia = 1.f;
else
wheel.inertia = inertia;
}
else if ( !Q_stricmp( key, "damping" ) )
{