Skip to content

Commit

Permalink
Use gpGlobals->interval_per_tick instead of DEFAULT_TICK_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
tyabus committed May 19, 2021
1 parent 0d8dcee commit 75f6986
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions mp/src/game/server/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void CPhysicsHook::LevelInitPreEntity()

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;
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions sp/src/game/server/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void CPhysicsHook::LevelInitPreEntity()

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;
Expand Down Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 75f6986

Please sign in to comment.