summaryrefslogtreecommitdiff
path: root/src/clientmap.cpp
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2014-01-08 13:47:53 +0100
committerBlockMen <nmuelll@web.de>2014-04-12 17:44:15 +0200
commita1db9242ec491efdee70a7184aa61e861b17595a (patch)
tree04bdd2302f8b3c4285ddb8f5ba669f7adc6bf4b9 /src/clientmap.cpp
parente149d1ad9a623b9f8ca597839f7b850841c54781 (diff)
downloadminetest-a1db9242ec491efdee70a7184aa61e861b17595a.tar.gz
minetest-a1db9242ec491efdee70a7184aa61e861b17595a.tar.bz2
minetest-a1db9242ec491efdee70a7184aa61e861b17595a.zip
Add third person view
Diffstat (limited to 'src/clientmap.cpp')
-rw-r--r--src/clientmap.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/clientmap.cpp b/src/clientmap.cpp
index 20a59f266..c8b2d412d 100644
--- a/src/clientmap.cpp
+++ b/src/clientmap.cpp
@@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "mapblock.h"
#include "profiler.h"
#include "settings.h"
+#include "game.h" // CameraModes
#include "util/mathconstants.h"
#include <algorithm>
@@ -866,13 +867,16 @@ void ClientMap::renderPostFx()
v3f camera_position = m_camera_position;
m_camera_mutex.Unlock();
+ LocalPlayer *player = m_client->getEnv().getLocalPlayer();
+
MapNode n = getNodeNoEx(floatToInt(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 = nodemgr->get(n);
video::SColor post_effect_color = features.post_effect_color;
- if(features.solidness == 2 && !(g_settings->getBool("noclip") && m_gamedef->checkLocalPrivilege("noclip")))
+ if(features.solidness == 2 && !(g_settings->getBool("noclip") && m_gamedef->checkLocalPrivilege("noclip")) && player->camera_mode == CAMERA_MODE_FIRST)
{
post_effect_color = video::SColor(255, 0, 0, 0);
}