From 55804c56e9485659c912bf965761187b9ec0597f Mon Sep 17 00:00:00 2001 From: lhofhansl Date: Sat, 7 Jan 2023 16:31:31 -0800 Subject: [PATCH] Report collisionMoveSimple for client and server. (#13105) --- src/collision.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/collision.cpp b/src/collision.cpp index e363673fe..575e70ff9 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -229,10 +229,12 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, v3f accel_f, ActiveObject *self, bool collideWithObjects) { + #define PROFILER_NAME(text) (s_env ? ("Server: " text) : ("Client: " text)) static bool time_notification_done = false; Map *map = &env->getMap(); + ServerEnvironment *s_env = dynamic_cast(env); - ScopeProfiler sp(g_profiler, "collisionMoveSimple()", SPT_AVG); + ScopeProfiler sp(g_profiler, PROFILER_NAME("collisionMoveSimple()"), SPT_AVG); collisionMoveResult result; @@ -271,7 +273,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, std::vector cinfo; { //TimeTaker tt2("collisionMoveSimple collect boxes"); - ScopeProfiler sp2(g_profiler, "collisionMoveSimple(): collect boxes", SPT_AVG); + ScopeProfiler sp2(g_profiler, PROFILER_NAME("collisionMoveSimple(): collect boxes"), SPT_AVG); v3f minpos_f( MYMIN(pos_f->X, newpos_f.X), @@ -390,7 +392,6 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, else #endif { - ServerEnvironment *s_env = dynamic_cast(env); if (s_env != NULL) { // Calculate distance by speed, add own extent and 1.5m of tolerance f32 distance = speed_f->getLength() * dtime +