mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 17:59:37 +00:00
physics: fix a lot of problems
This commit is contained in:
@@ -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" ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user