fix address sanitizer issues #2

This commit is contained in:
nillerusr
2022-05-01 20:08:32 +03:00
parent ce68fffa3b
commit 61cd8d0afc
27 changed files with 119 additions and 91 deletions

View File

@@ -647,8 +647,6 @@ void CPhysicsObject::SetInertia( const Vector &inertia )
ri.k[1] = IVP_Inline_Math::fabsd(ri.k[1]);
ri.k[2] = IVP_Inline_Math::fabsd(ri.k[2]);
if( ri.k[0] > 1e14f ) ri.k[0] = 1e14f; if( ri.k[1] > 1e14f ) ri.k[1] = 1e14f; if( ri.k[2] > 1e14f ) ri.k[2] = 1e14f;
m_pObject->get_core()->set_rotation_inertia( &ri );
}

View File

@@ -174,8 +174,7 @@ void CVPhysicsParse::ParseSolid( solid_t *pSolid, IVPhysicsKeyHandler *unknownKe
}
else if ( !Q_stricmp( key, "inertia" ) )
{
float inertia = atof(value);
pSolid->params.inertia = (inertia > 1e14f) ? 1e14f : inertia;
pSolid->params.inertia = atof(value);
}
else if ( !Q_stricmp( key, "damping" ) )
{
@@ -469,8 +468,7 @@ void CVPhysicsParse::ParseVehicleWheel( vehicle_wheelparams_t &wheel )
}
else if ( !Q_stricmp( key, "inertia" ) )
{
float inertia = atof(value);
wheel.inertia = (inertia > 1e14f) ? 1e14f : inertia;
wheel.inertia = atof(value);
}
else if ( !Q_stricmp( key, "damping" ) )
{