summaryrefslogtreecommitdiff
path: root/src/player.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-29 21:21:34 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-03-29 21:21:34 +0300
commit42bbd5c9ae06a8d8ffb7915599097ead6f848755 (patch)
tree26cb28be201826f6a624abeb1c26375af4f75c58 /src/player.cpp
parent92ae11bd3b5e95ff837f98463931e7772c455ad3 (diff)
downloadminetest-42bbd5c9ae06a8d8ffb7915599097ead6f848755.tar.gz
minetest-42bbd5c9ae06a8d8ffb7915599097ead6f848755.tar.bz2
minetest-42bbd5c9ae06a8d8ffb7915599097ead6f848755.zip
Simple fix for camera blinking black when jumping into ceiling with current smaller collision box
Diffstat (limited to 'src/player.cpp')
-rw-r--r--src/player.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/player.cpp b/src/player.cpp
index ff272322f..6e8b8c1d4 100644
--- a/src/player.cpp
+++ b/src/player.cpp
@@ -40,6 +40,7 @@ Player::Player(IGameDef *gamedef):
in_water_stable(false),
is_climbing(false),
swimming_up(false),
+ camera_barely_in_ceiling(false),
inventory(gamedef->idef()),
hp(PLAYER_MAX_HP),
peer_id(PEER_ID_INEXISTENT),
@@ -604,6 +605,17 @@ void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d,
MtEvent *e = new SimpleTriggerEvent("PlayerRegainGround");
m_gamedef->event()->put(e);
}
+
+ {
+ camera_barely_in_ceiling = false;
+ v3s16 camera_np = floatToInt(getEyePosition(), BS);
+ MapNode n = map.getNodeNoEx(camera_np);
+ if(n.getContent() != CONTENT_IGNORE){
+ if(nodemgr->get(n).walkable){
+ camera_barely_in_ceiling = true;
+ }
+ }
+ }
}
void LocalPlayer::move(f32 dtime, Map &map, f32 pos_max_d)