aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2022-05-21 19:27:35 +0200
committersfan5 <sfan5@live.de>2022-06-03 21:48:52 +0200
commit5f3af7d18b528e502e2cf09e0f46cc892df98dd4 (patch)
tree9531d70a9c36bf108d71fc1c1fd6974a5c62d0c4 /src
parent6a6b579c5472065dd4ba8edcebe120b4b1c9198e (diff)
downloadminetest-5f3af7d18b528e502e2cf09e0f46cc892df98dd4.tar.gz
minetest-5f3af7d18b528e502e2cf09e0f46cc892df98dd4.tar.bz2
minetest-5f3af7d18b528e502e2cf09e0f46cc892df98dd4.zip
Remove obsolete eye_height related workaround
This was added a long time ago in 42bbd5c9ae06a8d8ffb7915599097ead6f848755 and meant to fix prevent the view becoming black when jumping into a ceiling, this no longer happens today.
Diffstat (limited to 'src')
-rw-r--r--src/client/localplayer.cpp23
-rw-r--r--src/client/localplayer.h1
2 files changed, 1 insertions, 23 deletions
diff --git a/src/client/localplayer.cpp b/src/client/localplayer.cpp
index 279efafe9..79fe2cb11 100644
--- a/src/client/localplayer.cpp
+++ b/src/client/localplayer.cpp
@@ -426,16 +426,6 @@ void LocalPlayer::move(f32 dtime, Environment *env, f32 pos_max_d,
camera_impact = getSpeed().Y * -1;
}
- {
- camera_barely_in_ceiling = false;
- v3s16 camera_np = floatToInt(getEyePosition(), BS);
- MapNode n = map->getNode(camera_np);
- if (n.getContent() != CONTENT_IGNORE) {
- if (nodemgr->get(n).walkable && nodemgr->get(n).solidness == 2)
- camera_barely_in_ceiling = true;
- }
- }
-
/*
Check properties of the node on which the player is standing
*/
@@ -696,8 +686,7 @@ v3s16 LocalPlayer::getLightPosition() const
v3f LocalPlayer::getEyeOffset() const
{
- float eye_height = camera_barely_in_ceiling ? m_eye_height - 0.125f : m_eye_height;
- return v3f(0.0f, BS * eye_height, 0.0f);
+ return v3f(0.0f, BS * m_eye_height, 0.0f);
}
ClientActiveObject *LocalPlayer::getParent() const
@@ -1025,16 +1014,6 @@ void LocalPlayer::old_move(f32 dtime, Environment *env, f32 pos_max_d,
camera_impact = getSpeed().Y * -1.0f;
}
- {
- camera_barely_in_ceiling = false;
- v3s16 camera_np = floatToInt(getEyePosition(), BS);
- MapNode n = map->getNode(camera_np);
- if (n.getContent() != CONTENT_IGNORE) {
- if (nodemgr->get(n).walkable && nodemgr->get(n).solidness == 2)
- camera_barely_in_ceiling = true;
- }
- }
-
/*
Update the node last under the player
*/
diff --git a/src/client/localplayer.h b/src/client/localplayer.h
index 3d0072fc1..650a01574 100644
--- a/src/client/localplayer.h
+++ b/src/client/localplayer.h
@@ -199,7 +199,6 @@ private:
u16 m_breath = PLAYER_MAX_BREATH_DEFAULT;
f32 m_yaw = 0.0f;
f32 m_pitch = 0.0f;
- bool camera_barely_in_ceiling = false;
aabb3f m_collisionbox = aabb3f(-BS * 0.30f, 0.0f, -BS * 0.30f, BS * 0.30f,
BS * 1.75f, BS * 0.30f);
float m_eye_height = 1.625f;