revert me after

This commit is contained in:
nillerusr 2023-10-16 07:54:56 +03:00
parent 5a4d0b7a4d
commit ee6a6d0b37
4 changed files with 12 additions and 4 deletions

View File

@ -6586,7 +6586,7 @@ void CAI_BaseNPC::SetupVPhysicsHull()
#endif
IPhysicsShadowController *pController = pPhysObj->GetShadowController();
float avgsize = (WorldAlignSize().x + WorldAlignSize().y) * 0.5;
pController->SetTeleportDistance( avgsize * 0.5 );
//pController->SetTeleportDistance( avgsize * 0.5 );
m_bCheckContacts = true;
}
}
@ -6598,6 +6598,8 @@ void CAI_BaseNPC::SetupVPhysicsHull()
ConVar ai_auto_contact_solver( "ai_auto_contact_solver", "1" );
void CAI_BaseNPC::CheckPhysicsContacts()
{
return;
if ( gpGlobals->frametime <= 0.0f || !ai_auto_contact_solver.GetBool() )
return;
@ -6616,6 +6618,8 @@ void CAI_BaseNPC::CheckPhysicsContacts()
while ( pSnapshot->IsValid() )
{
IPhysicsObject *pOther = pSnapshot->GetObject(1);
if( !pOther )
continue;
pOtherEntity = static_cast<CBaseEntity *>(pOther->GetGameData());
if ( pOtherEntity && pGroundEntity != pOtherEntity )

View File

@ -603,7 +603,7 @@ IPhysicsObject *PhysCreateWorld_Shared( CBaseEntity *pWorld, vcollide_t *pWorldC
pWorldCollide->solids[0], surfaceData, vec3_origin, vec3_angle, &params );
// hint - saves vphysics some work
pWorldPhysics->SetCallbackFlags( pWorldPhysics->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
//pWorldPhysics->SetCallbackFlags( pWorldPhysics->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
//PhysCheckAdd( world, "World" );
// walk the world keys in case there are some fluid volumes to create
@ -667,8 +667,8 @@ IPhysicsObject *PhysCreateWorld_Shared( CBaseEntity *pWorld, vcollide_t *pWorldC
IPhysicsObject *pWater = physenv->CreatePolyObjectStatic( pWorldCollide->solids[fluid.index],
surfaceData, vec3_origin, vec3_angle, &solid.params );
pWater->SetCallbackFlags( pWater->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
physenv->CreateFluidController( pWater, &fluid.params );
//pWater->SetCallbackFlags( pWater->GetCallbackFlags() | CALLBACK_NEVER_DELETED );
//physenv->CreateFluidController( pWater, &fluid.params );
}
}
else if ( !strcmpi( pBlock, "materialtable" ) )

View File

@ -100,6 +100,8 @@ void PhysFrictionEffect( Vector &vecPos, Vector vecVel, float energy, int surfac
// ORs gameFlags with the physics object's current game flags
inline unsigned short PhysSetGameFlags( IPhysicsObject *pPhys, unsigned short gameFlags )
{
return 0;
unsigned short flags = pPhys->GetGameFlags();
flags |= gameFlags;
pPhys->SetGameFlags( flags );

View File

@ -269,6 +269,8 @@ static void RagdollCreateObjects( IPhysicsEnvironment *pPhysEnv, ragdoll_t &ragd
memset( ragdoll.list, 0, sizeof(ragdoll.list) );
memset( &ragdoll.animfriction, 0, sizeof(ragdoll.animfriction) );
return;
if ( !params.pCollide || params.pCollide->solidCount > RAGDOLL_MAX_ELEMENTS )
return;