This commit is contained in:
speedvoltage 2025-04-04 01:51:26 +02:00 committed by GitHub
commit bd8cd0b3c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1566,6 +1566,18 @@ void CPropCombineBall::VPhysicsCollision( int index, gamevcollisionevent_t *pEve
{
Vector preVelocity = pEvent->preVelocity[index];
float flSpeed = VectorNormalize( preVelocity );
CBaseEntity *pHitEntity = pEvent->pEntities[ !index ];
if ( FClassnameIs( pHitEntity, "npc_satchel" ) || // don't slow down on satchel charges
FClassnameIs( pHitEntity, "npc_grenade_frag" ) || // not on frag grenades either
StringHasPrefix( pHitEntity->GetClassname(), "weapon_" ) || // much less on weapons
StringHasPrefix( pHitEntity->GetClassname(), "item_" ) ) // the same for items
{
Vector vecBounceVelocity = -preVelocity;
vecBounceVelocity *= GetSpeed();
PhysCallbackSetVelocity( pEvent->pObjects[ index ], vecBounceVelocity );
return;
}
if ( m_nMaxBounces == -1 )
{
@ -1573,7 +1585,7 @@ void CPropCombineBall::VPhysicsCollision( int index, gamevcollisionevent_t *pEve
if( pHit->game.material != CHAR_TEX_FLESH || !hl2_episodic.GetBool() )
{
CBaseEntity *pHitEntity = pEvent->pEntities[!index];
if ( pHitEntity && IsHittableEntity( pHitEntity ) )
{
OnHitEntity( pHitEntity, flSpeed, index, pEvent );
@ -1610,7 +1622,6 @@ void CPropCombineBall::VPhysicsCollision( int index, gamevcollisionevent_t *pEve
vecFinalVelocity *= GetSpeed();
PhysCallbackSetVelocity( pEvent->pObjects[index], vecFinalVelocity );
CBaseEntity *pHitEntity = pEvent->pEntities[!index];
if ( pHitEntity && IsHittableEntity( pHitEntity ) )
{
OnHitEntity( pHitEntity, flSpeed, index, pEvent );