From 1d6eaceb3639713030ebb7f79959ffaeeef8ac1c Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:58:36 +0400 Subject: [PATCH] WIP --- server/physic.cpp | 12 ++++++++++-- server/physx/physx_impl.cpp | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/server/physic.cpp b/server/physic.cpp index a85ac6f90..7dba712f3 100644 --- a/server/physic.cpp +++ b/server/physic.cpp @@ -605,6 +605,9 @@ bool CPhysicsPushedEntities::SpeculativelyCheckPush( PhysicsPushedInfo_t &info, if( bIsUnblockable ) { pBlocker->SetAbsOrigin( pushDestPosition ); + //if (bIsDynamic) { + // WorldPhysic->SetOrigin( pBlocker, pushDestPosition ); + //} } else { @@ -614,7 +617,10 @@ bool CPhysicsPushedEntities::SpeculativelyCheckPush( PhysicsPushedInfo_t &info, if( !info.m_trace.fAllSolid ) { pBlocker->SetAbsOrigin( info.m_trace.vecEndPos ); - } + //if (bIsDynamic) { + // WorldPhysic->SetOrigin( pBlocker, pushDestPosition ); + } + //} else if( pBlocker->m_iActorType == ACTOR_DYNAMIC && !info.m_bPusherIsGround && !bRotationalPush ) { return false; @@ -2516,7 +2522,9 @@ void SV_Physics_Pusher( CBaseEntity *pEntity ) // if the pusher has a "blocked" function, call it // otherwise, just stay in place until the obstacle is gone - if( pBlocker ) DispatchBlocked( pEntity->edict(), pBlocker->edict() ); + if (pBlocker) { + DispatchBlocked(pEntity->edict(), pBlocker->edict()); + } // NOTE: all the entities with MOVETYPE_PUSH now has two seperated thinks: // normal regular thinking and local think (movedone) diff --git a/server/physx/physx_impl.cpp b/server/physx/physx_impl.cpp index a3a9e6bd2..a0d2af1ed 100644 --- a/server/physx/physx_impl.cpp +++ b/server/physx/physx_impl.cpp @@ -225,8 +225,6 @@ void CPhysicPhysX :: Update( float flTimeDelta ) } } - HandleEvents(); - m_flAccumulator += flTimeDelta; while (m_flAccumulator > k_SimulationStepSize) { @@ -234,6 +232,8 @@ void CPhysicPhysX :: Update( float flTimeDelta ) m_pScene->simulate(k_SimulationStepSize); m_pScene->fetchResults(true); } + + HandleEvents(); } void CPhysicPhysX :: EndFrame( void )