From 0a55a71ac30caebddae47eec86d82676d8f3ad6b Mon Sep 17 00:00:00 2001 From: SanyaSho Date: Tue, 16 Aug 2022 15:47:40 +0300 Subject: [PATCH] game: use gpGlobals->interval_per_tick instead of DEFAULT_TICK_INTERVAL (ValveSoftware/source-sdk-2013#515) --- game/server/physics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/game/server/physics.cpp b/game/server/physics.cpp index 2adc5587ad..8d2c54d422 100644 --- a/game/server/physics.cpp +++ b/game/server/physics.cpp @@ -242,8 +242,8 @@ void CPhysicsHook::LevelInitPreEntity() physenv->EnableConstraintNotify( true ); // callback when an object gets deleted that is attached to a constraint physenv->SetObjectEventHandler( &g_Collisions ); - - physenv->SetSimulationTimestep( DEFAULT_TICK_INTERVAL ); // 15 ms per tick + + physenv->SetSimulationTimestep( gpGlobals->interval_per_tick ); // 15 ms per tick // HL Game gravity, not real-world gravity physenv->SetGravity( Vector( 0, 0, -GetCurrentGravity() ) ); g_PhysAverageSimTime = 0; @@ -1606,7 +1606,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" ) float totalTime = 0.f; g_Collisions.BufferTouchEvents( true ); float full = engine->Time(); - physenv->Simulate( DEFAULT_TICK_INTERVAL ); + physenv->Simulate( gpGlobals->interval_per_tick ); full = engine->Time() - full; float lastTime = full; @@ -1623,7 +1623,7 @@ CON_COMMAND( physics_budget, "Times the cost of each active object" ) PhysForceEntityToSleep( ents[j], ents[j]->VPhysicsGetObject() ); } float start = engine->Time(); - physenv->Simulate( DEFAULT_TICK_INTERVAL ); + physenv->Simulate( gpGlobals->interval_per_tick ); float end = engine->Time(); float elapsed = end - start;