1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-01 07:45:26 +01:00

Slippery physics override setting

Allows mods to change a player's slip factor (e.g. wearing boots could
reduce this)

Note: Require assistance on implementing needed changed protocol version
check in I_object!
This commit is contained in:
cmdskp
2015-12-29 18:15:51 +00:00
parent fe1b5b4947
commit b6b0b831ac
12 changed files with 39 additions and 20 deletions

View File

@@ -95,6 +95,7 @@ Player::Player(IGameDef *gamedef, const char *name):
physics_override_speed = 1;
physics_override_jump = 1;
physics_override_gravity = 1;
physics_override_slip = 1;
physics_override_sneak = true;
physics_override_sneak_glitch = true;
@@ -121,9 +122,9 @@ void Player::accelerateHorizontal(v3f target_speed, f32 max_increase, int slippe
if (slippery)
{
if (target_speed == v3f(0))
d_wanted = -m_speed*.5/slippery;
d_wanted = -m_speed * 5 / slippery;
else
d_wanted = target_speed*.1 - m_speed*.1;
d_wanted = target_speed * .1 - m_speed * .1;
}
d_wanted.Y = 0;
f32 dl = d_wanted.getLength();