Add sv_stuck_prop_disable_collisions

► Added sv_stuck_prop_disable_collisions to control whether server ops want to disable collisions for stuck props in walls. Some maps like js_build_puzzle use those mechanics to solve some puzzles.
This commit is contained in:
speedvoltage 2025-03-15 11:39:08 +01:00
parent 2533e18427
commit a08793a34d

View file

@ -64,7 +64,7 @@ extern CBaseEntity *FindPickerEntity( CBasePlayer *pPlayer );
ConVar g_debug_doors( "g_debug_doors", "0" );
ConVar breakable_disable_gib_limit( "breakable_disable_gib_limit", "0" );
ConVar breakable_multiplayer( "breakable_multiplayer", "1" );
ConVar sv_stuck_prop_disable_collisions( "sv_stuck_prop_disable_collisions", "1", 0, "If non-zero, props like saw blades, harpoons, etc that stick to a wall will not collide with players" );
// AI Interaction for being hit by a physics object
int g_interactionHitByPlayerThrownPhysObj = 0;
int g_interactionPlayerPuntedHeavyObject = 0;
@ -655,7 +655,10 @@ void CBreakableProp::StickAtPosition( const Vector &stickPosition, const Vector
VPhysicsGetObject()->EnableMotion( false );
AddSpawnFlags( SF_PHYSPROP_ENABLE_ON_PHYSCANNON );
SetCollisionGroup( COLLISION_GROUP_INTERACTIVE );
if ( sv_stuck_prop_disable_collisions.GetBool() )
SetCollisionGroup( COLLISION_GROUP_DEBRIS );
else
SetCollisionGroup( COLLISION_GROUP_INTERACTIVE );
}
//-----------------------------------------------------------------------------