diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2016-02-20 09:44:22 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2016-02-20 09:44:22 +0100 |
commit | c6d7d2097c3736b3de82f074c63eda959c07290f (patch) | |
tree | 06edc3cbc29602560fcafed67cb49d09558a3cd8 /src/collision.cpp | |
parent | 60dc01dc258db842e229351b871d0989e3e7d62c (diff) | |
download | minetest-c6d7d2097c3736b3de82f074c63eda959c07290f.tar.gz minetest-c6d7d2097c3736b3de82f074c63eda959c07290f.tar.bz2 minetest-c6d7d2097c3736b3de82f074c63eda959c07290f.zip |
Little collision.cpp cleanups
Diffstat (limited to 'src/collision.cpp')
-rw-r--r-- | src/collision.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/collision.cpp b/src/collision.cpp index a2d17d51a..4680e0a5e 100644 --- a/src/collision.cpp +++ b/src/collision.cpp @@ -235,7 +235,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, std::vector<v3s16> node_positions; { //TimeTaker tt2("collisionMoveSimple collect boxes"); - ScopeProfiler sp(g_profiler, "collisionMoveSimple collect boxes avg", SPT_AVG); + ScopeProfiler sp(g_profiler, "collisionMoveSimple collect boxes avg", SPT_AVG); v3s16 oldpos_i = floatToInt(*pos_f, BS); v3s16 newpos_i = floatToInt(*pos_f + *speed_f * dtime, BS); @@ -383,13 +383,12 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, while(dtime > BS * 1e-10) { //TimeTaker tt3("collisionMoveSimple dtime loop"); - ScopeProfiler sp(g_profiler, "collisionMoveSimple dtime loop avg", SPT_AVG); + ScopeProfiler sp(g_profiler, "collisionMoveSimple dtime loop avg", SPT_AVG); // Avoid infinite loop loopcount++; if (loopcount >= 100) { warningstream << "collisionMoveSimple: Loop count exceeded, aborting to avoid infiniite loop" << std::endl; - dtime = 0; break; } @@ -399,7 +398,7 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef, int nearest_collided = -1; f32 nearest_dtime = dtime; - u32 nearest_boxindex = -1; + int nearest_boxindex = -1; /* Go through every nodebox, find nearest collision |