@@ -283,8 +283,7 @@ void Camera::addArmInertia(f32 player_yaw)
283
283
}
284
284
}
285
285
286
- void Camera::update (LocalPlayer* player, f32 frametime, f32 busytime,
287
- f32 tool_reload_ratio, ClientEnvironment &c_env)
286
+ void Camera::update (LocalPlayer* player, f32 frametime, f32 busytime, f32 tool_reload_ratio)
288
287
{
289
288
// Get player position
290
289
// Smooth the movement when walking up stairs
@@ -408,19 +407,19 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
408
407
409
408
// Calculate new position
410
409
bool abort = false ;
411
- for (int i = BS; i <= BS*2.75 ; i++)
412
- {
413
- my_cp.X = m_camera_position.X + m_camera_direction.X *-i;
414
- my_cp.Z = m_camera_position.Z + m_camera_direction.Z *-i;
410
+ for (int i = BS; i <= BS * 2.75 ; i++) {
411
+ my_cp.X = m_camera_position.X + m_camera_direction.X * -i;
412
+ my_cp.Z = m_camera_position.Z + m_camera_direction.Z * -i;
415
413
if (i > 12 )
416
- my_cp.Y = m_camera_position.Y + (m_camera_direction.Y * -i);
414
+ my_cp.Y = m_camera_position.Y + (m_camera_direction.Y * -i);
417
415
418
416
// Prevent camera positioned inside nodes
419
417
INodeDefManager *nodemgr = m_client->ndef ();
420
- MapNode n = c_env.getClientMap ().getNodeNoEx (floatToInt (my_cp, BS));
418
+ MapNode n = m_client->getEnv ().getClientMap ()
419
+ .getNodeNoEx (floatToInt (my_cp, BS));
420
+
421
421
const ContentFeatures& features = nodemgr->get (n);
422
- if (features.walkable )
423
- {
422
+ if (features.walkable ) {
424
423
my_cp.X += m_camera_direction.X *-1 *-BS/2 ;
425
424
my_cp.Z += m_camera_direction.Z *-1 *-BS/2 ;
426
425
my_cp.Y += m_camera_direction.Y *-1 *-BS/2 ;
0 commit comments