mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Allow modifying movement speed, jump height and gravity per-player via the Lua API.
This commit is contained in:
parent
2a0badf2d5
commit
c5a8448c41
14 changed files with 97 additions and 10 deletions
|
@ -1679,6 +1679,19 @@ public:
|
|||
|
||||
updateTexturePos();
|
||||
}
|
||||
else if(cmd == GENERIC_CMD_SET_PHYSICS_OVERRIDE)
|
||||
{
|
||||
float override_speed = readF1000(is);
|
||||
float override_jump = readF1000(is);
|
||||
float override_gravity = readF1000(is);
|
||||
if(m_is_local_player)
|
||||
{
|
||||
LocalPlayer *player = m_env->getLocalPlayer();
|
||||
player->physics_override_speed = override_speed;
|
||||
player->physics_override_jump = override_jump;
|
||||
player->physics_override_gravity = override_gravity;
|
||||
}
|
||||
}
|
||||
else if(cmd == GENERIC_CMD_SET_ANIMATION)
|
||||
{
|
||||
m_animation_range = readV2F1000(is);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue