diff options
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index ea2da15da..05195c91f 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -362,20 +362,22 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d, // Force update each ClientEnvironment::step() bool is_first = collision_info->empty(); - for (const auto &colinfo : result.collisions) { - collision_info->push_back(colinfo); + for (std::vector<CollisionInfo>::const_iterator + colinfo = result.collisions.begin(); + colinfo != result.collisions.end(); ++colinfo) { + collision_info->push_back(*colinfo); - if (colinfo.type != COLLISION_NODE || - colinfo.new_speed.Y != 0 || + if (colinfo->type != COLLISION_NODE || + colinfo->new_speed.Y != 0 || (could_sneak && m_sneak_node_exists)) continue; - diff = intToFloat(colinfo.node_p, BS) - position; + diff = intToFloat(colinfo->node_p, BS) - position; // Find nearest colliding node f32 len = diff.getLength(); if (is_first || len < distance) { - m_standing_node = colinfo.node_p; + m_standing_node = colinfo->node_p; distance = len; } } |