1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Sneak: Replicate sneak ladder in new code, is optional

Enabled using the existing 'sneak_glitch' physics override.
This commit is contained in:
sfan5 2017-03-23 21:47:59 +01:00 committed by paramat
parent e70e15134c
commit 1139a18c3a
2 changed files with 89 additions and 21 deletions

View file

@ -135,15 +135,18 @@ private:
void accelerateVertical(const v3f &target_speed, const f32 max_increase);
v3f m_position;
// This is used for determining the sneaking range
v3s16 m_sneak_node;
// Stores the top bounding box of m_sneak_node
aabb3f m_sneak_node_bb_top;
// Whether the player is allowed to sneak
bool m_sneak_node_exists;
// Whether recalculation of the sneak node is needed
// Whether recalculation of m_sneak_node and its top bbox is needed
bool m_need_to_get_new_sneak_node;
// Stores the top bounding box of m_sneak_node and is updated
// when m_need_to_get_new_sneak_node == true
aabb3f m_sneak_node_bb_top;
// 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;
// Node below player, used to determine whether it has been removed,
// and its old type
v3s16 m_old_node_below;