diff options
author | lhofhansl <larsh@apache.org> | 2023-01-07 16:31:31 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-07 16:31:31 -0800 |
commit | 55804c56e9485659c912bf965761187b9ec0597f (patch) | |
tree | 86195bd1b35f0142f65ce6d15cc908264f31f6ec /src | |
parent | d82d18bfb1a51e0f2f0a89999474e98890addf7e (diff) | |
download | minetest-55804c56e9485659c912bf965761187b9ec0597f.tar.xz |
Report collisionMoveSimple for client and server. (#13105)
Diffstat (limited to 'src')
-rw-r--r-- | src/collision.cpp | 7 |
1 files 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<ServerEnvironment*>(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<NearbyCollisionInfo> 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<ServerEnvironment*>(env); if (s_env != NULL) { // Calculate distance by speed, add own extent and 1.5m of tolerance f32 distance = speed_f->getLength() * dtime + |