From 326e3665a6a0dde69bd2c46846d05d98b8796158 Mon Sep 17 00:00:00 2001 From: wjxggg <86282925@qq.com> Date: Thu, 9 Jan 2025 23:04:30 +0800 Subject: [PATCH 1/2] fix wrong collision box scaling of physics props --- game/server/props.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game/server/props.cpp b/game/server/props.cpp index 5a9816875..c6c197155 100644 --- a/game/server/props.cpp +++ b/game/server/props.cpp @@ -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 ); From f834704bc2413394d40751e068bb1f2b9346eb11 Mon Sep 17 00:00:00 2001 From: wjxggg <86282925@qq.com> Date: Sat, 11 Jan 2025 21:46:28 +0800 Subject: [PATCH 2/2] fix CBaseAnimating::TestHitboxes --- game/client/c_baseanimating.cpp | 3 ++- game/server/baseanimating.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/game/client/c_baseanimating.cpp b/game/client/c_baseanimating.cpp index d66339e53..718eed202 100644 --- a/game/client/c_baseanimating.cpp +++ b/game/client/c_baseanimating.cpp @@ -4981,9 +4981,10 @@ bool C_BaseAnimating::TestHitboxes( const Ray_t &ray, unsigned int fContentsMask VPhysicsSetObject( pReplace ); } } + return true; } - return true; + return false; } diff --git a/game/server/baseanimating.cpp b/game/server/baseanimating.cpp index 39f03900b..67218922a 100644 --- a/game/server/baseanimating.cpp +++ b/game/server/baseanimating.cpp @@ -2693,8 +2693,9 @@ bool CBaseAnimating::TestHitboxes( const Ray_t &ray, unsigned int fContentsMask, tr.surface.name = "**studio**"; tr.surface.flags = SURF_HITBOX; tr.surface.surfaceProps = physprops->GetSurfaceIndex( pBone->pszSurfaceProp() ); + return true; } - return true; + return false; } void CBaseAnimating::InitBoneControllers ( void ) // FIXME: rename