mirror of
https://github.com/nillerusr/source-engine.git
synced 2025-04-11 18:57:47 +00:00
fix wrong collision box scaling of physics props
This commit is contained in:
parent
29985681a1
commit
326e3665a6
@ -6071,18 +6071,18 @@ bool UTIL_CreateScaledPhysObject( CBaseAnimating *pInstance, float flScale )
|
||||
pInstance->VPhysicsDestroyObject();
|
||||
pInstance->VPhysicsSetObject( pNewObject );
|
||||
|
||||
// Scale the base model as well
|
||||
pInstance->SetModelScale( flScale );
|
||||
|
||||
// Increase our model bounds
|
||||
const model_t *pModel = modelinfo->GetModel( pInstance->GetModelIndex() );
|
||||
if ( pModel )
|
||||
{
|
||||
Vector mins, maxs;
|
||||
modelinfo->GetModelBounds( pModel, mins, maxs );
|
||||
pInstance->SetCollisionBounds( mins*flScale, maxs*flScale );
|
||||
pInstance->SetCollisionBounds( mins, maxs );
|
||||
}
|
||||
|
||||
// Scale the base model as well
|
||||
pInstance->SetModelScale( flScale );
|
||||
|
||||
if ( pInstance->GetParent() )
|
||||
{
|
||||
pNewObject->SetShadow( 1e4, 1e4, false, false );
|
||||
|
Loading…
Reference in New Issue
Block a user