1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Don't pass non-const references to collision methods

Non const references cause a lot of confusion with behaviour of code,
and are disallowed by minetest style guide.
This commit is contained in:
est31 2016-01-25 00:06:01 +01:00
parent ad884f23d4
commit 4e93ba06a7
7 changed files with 98 additions and 108 deletions

View file

@ -1192,15 +1192,13 @@ void GenericCAO::step(float dtime, ClientEnvironment *env)
f32 pos_max_d = BS*0.125; // Distance per iteration
v3f p_pos = m_position;
v3f p_velocity = m_velocity;
v3f p_acceleration = m_acceleration;
moveresult = collisionMoveSimple(env,env->getGameDef(),
pos_max_d, box, m_prop.stepheight, dtime,
p_pos, p_velocity, p_acceleration,
&p_pos, &p_velocity, m_acceleration,
this, m_prop.collideWithObjects);
// Apply results
m_position = p_pos;
m_velocity = p_velocity;
m_acceleration = p_acceleration;
bool is_end_position = moveresult.collides;
pos_translator.update(m_position, is_end_position, dtime);