mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
Rehook dPhysics to main framerate
Should fix bug causing double enter and exit events
This commit is contained in:
@@ -223,9 +223,7 @@ int main(int argc, char** argv) {
|
||||
int framesSinceMasterStatus = 0;
|
||||
int framesSinceShutdownSequence = 0;
|
||||
int currentFramerate = highFrameRate;
|
||||
int physicsFramerate = highFrameRate;
|
||||
int physicsStepRate = 0;
|
||||
int physicsStepCount = 0;
|
||||
|
||||
int ghostingStepCount = 0;
|
||||
auto ghostingLastTime = std::chrono::high_resolution_clock::now();
|
||||
|
||||
@@ -300,9 +298,6 @@ int main(int argc, char** argv) {
|
||||
{
|
||||
currentFramerate = PerformanceManager::GetServerFramerate();
|
||||
}
|
||||
|
||||
physicsFramerate = PerformanceManager::GetPhysicsFramerate();
|
||||
physicsStepRate = PerformanceManager::GetPhysicsStepRate();
|
||||
|
||||
//Warning if we ran slow
|
||||
if (deltaTime > currentFramerate) {
|
||||
@@ -338,10 +333,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
if (zoneID != 0 && deltaTime > 0.0f) {
|
||||
Metrics::StartMeasurement(MetricVariable::Physics);
|
||||
if (physicsStepCount++ >= physicsStepRate) {
|
||||
dpWorld::Instance().StepWorld(deltaTime);
|
||||
physicsStepCount = 0;
|
||||
}
|
||||
dpWorld::Instance().StepWorld(deltaTime);
|
||||
Metrics::EndMeasurement(MetricVariable::Physics);
|
||||
|
||||
Metrics::StartMeasurement(MetricVariable::UpdateEntities);
|
||||
|
Reference in New Issue
Block a user