]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/client/clientmap.cpp
Properly keep noclip state in Game and ClientMap
[dragonfireclient.git] / src / client / clientmap.cpp
index 98e3f40d3acb56fbe5485c6073e3e9b15ee05c69..38ba1daad2df308e0df0a8a6a09e2c259722c0cf 100644 (file)
@@ -219,13 +219,11 @@ void ClientMap::updateDrawList()
        // Number of blocks occlusion culled
        u32 blocks_occlusion_culled = 0;
 
-       // No occlusion culling when free_move is on and camera is
-       // inside ground
+       // No occlusion culling when free_move is on and camera is inside ground
        bool occlusion_culling_enabled = true;
-       if (g_settings->getBool("free_move") && g_settings->getBool("noclip")) {
+       if (m_control.allow_noclip) {
                MapNode n = getNode(cam_pos_nodes);
-               if (n.getContent() == CONTENT_IGNORE ||
-                               m_nodedef->get(n).solidness == 2)
+               if (n.getContent() == CONTENT_IGNORE || m_nodedef->get(n).solidness == 2)
                        occlusion_culling_enabled = false;
        }
 
@@ -678,19 +676,17 @@ void ClientMap::renderPostFx(CameraMode cam_mode)
 
        MapNode n = getNode(floatToInt(m_camera_position, BS));
 
-       // - If the player is in a solid node, make everything black.
-       // - If the player is in liquid, draw a semi-transparent overlay.
-       // - Do not if player is in third person mode
        const ContentFeatures& features = m_nodedef->get(n);
        video::SColor post_effect_color = features.post_effect_color;
-       if(features.solidness == 2 && !(g_settings->getBool("noclip") &&
-                       m_client->checkLocalPrivilege("noclip")) &&
-                       cam_mode == CAMERA_MODE_FIRST)
-       {
+
+       // If the camera is in a solid node, make everything black.
+       // (first person mode only)
+       if (features.solidness == 2 && cam_mode == CAMERA_MODE_FIRST &&
+               !m_control.allow_noclip) {
                post_effect_color = video::SColor(255, 0, 0, 0);
        }
-       if (post_effect_color.getAlpha() != 0)
-       {
+
+       if (post_effect_color.getAlpha() != 0) {
                // Draw a full-screen rectangle
                video::IVideoDriver* driver = SceneManager->getVideoDriver();
                v2u32 ss = driver->getScreenSize();