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

Sneak: Add option for old move code

Temporary option for the old move code for specific old sneak behaviour.
Enabled by setting the added 'new move' physics override to false.
By default 'new move' is true.
This commit is contained in:
paramat 2017-04-05 12:18:22 +01:00
parent 907be0ab91
commit f6da7b3fda
10 changed files with 349 additions and 12 deletions

View file

@ -58,12 +58,17 @@ public:
float physics_override_gravity;
bool physics_override_sneak;
bool physics_override_sneak_glitch;
// Temporary option for old move code
bool physics_override_new_move;
v3f overridePosition;
void move(f32 dtime, Environment *env, f32 pos_max_d);
void move(f32 dtime, Environment *env, f32 pos_max_d,
std::vector<CollisionInfo> *collision_info);
// Temporary option for old move code
void old_move(f32 dtime, Environment *env, f32 pos_max_d,
std::vector<CollisionInfo> *collision_info);
void applyControl(float dtime);
@ -137,6 +142,9 @@ private:
v3f m_position;
v3s16 m_sneak_node;
// Stores the max player uplift by m_sneak_node
// To support temporary option for old move code
f32 m_sneak_node_bb_ymax;
// Stores the top bounding box of m_sneak_node
aabb3f m_sneak_node_bb_top;
// Whether the player is allowed to sneak