summaryrefslogtreecommitdiff
path: root/src/localplayer.h
diff options
context:
space:
mode:
authorSmallJoker <mk939@ymail.com>2017-04-01 20:38:14 +0200
committerparamat <mat.gregory@virginmedia.com>2017-07-15 01:27:37 +0100
commita5c37717ffea387f8aa694f22ccc2f2f449826ac (patch)
treef3b40ee542e040926d89e70d5e4d5b0be5ee6203 /src/localplayer.h
parentdc3ca09e0e0e25f40cccae12c73830b0334ffb60 (diff)
downloadminetest-a5c37717ffea387f8aa694f22ccc2f2f449826ac.tar.gz
minetest-a5c37717ffea387f8aa694f22ccc2f2f449826ac.tar.bz2
minetest-a5c37717ffea387f8aa694f22ccc2f2f449826ac.zip
Sneak: Stripped down version
Fix taking damage caused by sneaking over a nodebox gap. Fix strange behaviour on stair nodeboxes. Enable jumping from node edges while sneaking. Enable movement around corners while sneaking on a 1-node-high groove in a wall.
Diffstat (limited to 'src/localplayer.h')
-rw-r--r--src/localplayer.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/localplayer.h b/src/localplayer.h
index af58ab037..32714ff32 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -143,30 +143,30 @@ public:
private:
void accelerateHorizontal(const v3f &target_speed, const f32 max_increase);
void accelerateVertical(const v3f &target_speed, const f32 max_increase);
+ bool updateSneakNode(Map *map, const v3f &position, const v3f &sneak_max);
v3f m_position;
v3s16 m_sneak_node = v3s16(32767, 32767, 32767);
- // Stores the max player uplift by m_sneak_node
- // To support temporary option for old move code
- f32 m_sneak_node_bb_ymax = 0.0f;
// Stores the top bounding box of m_sneak_node
aabb3f m_sneak_node_bb_top = aabb3f(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
// Whether the player is allowed to sneak
bool m_sneak_node_exists = false;
- // Whether recalculation of m_sneak_node and its top bbox is needed
- bool m_need_to_get_new_sneak_node = true;
// Whether a "sneak ladder" structure is detected at the players pos
// see detectSneakLadder() in the .cpp for more info (always false if disabled)
bool m_sneak_ladder_detected = false;
- // Whether a 2-node-up ledge is detected at the players pos,
- // see detectLedge() in the .cpp for more info (always false if disabled).
- bool m_ledge_detected = false;
+ // ***** Variables for temporary option of the old move code *****
+ // Stores the max player uplift by m_sneak_node
+ f32 m_sneak_node_bb_ymax = 0.0f;
+ // Whether recalculation of m_sneak_node and its top bbox is needed
+ bool m_need_to_get_new_sneak_node = true;
// Node below player, used to determine whether it has been removed,
// and its old type
v3s16 m_old_node_below = v3s16(32767, 32767, 32767);
std::string m_old_node_below_type = "air";
+ // ***** End of variables for temporary option *****
+
bool m_can_jump = false;
u16 m_breath = PLAYER_MAX_BREATH;
f32 m_yaw = 0.0f;