sneak and sneak_glitch of set_physics_override don’t work
Hi! I found the following in lua_api.txt:
However, if I use sneak=false or sneak_glitch=false, I can still sneak and use the sneak glitch.
Here is the code I used:
I killed my player to respawn but I still could sneak and use the sneak glitch. To test I did not do it wrong, I also added speed=4 to the table, to test that set_physics_override works at all. This worked, I was faster on respawn.
Since the speed increased, but I still could sneak and use the sneak glitch, I suspect a bug here.
This does neither work in 0.4.9 nor in b8343cd11c834fb2613b104418ed08e9fdb1665a.
To reproduce, do the following: Create a new mod folder and copy the following code above into init.lua. Start a new world and enable the mod. Join the world. Die. Respawn. Check how fast you walk and wheather you can sneak and use the sneak glitch.
The authors of lua_api.txt wrote:- set_physics_override({
speed = 1.0, -- multiplier to default value
jump = 1.0, -- multiplier to default value
gravity = 1.0, -- multiplier to default value
sneak = true, -- whether player can sneak
sneak_glitch = true, -- whether player can use the sneak glitch
})
However, if I use sneak=false or sneak_glitch=false, I can still sneak and use the sneak glitch.
Here is the code I used:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_on_respawnplayer(function(player)
player:set_physics_override({sneak=false, sneak_glitch=false})
end)
I killed my player to respawn but I still could sneak and use the sneak glitch. To test I did not do it wrong, I also added speed=4 to the table, to test that set_physics_override works at all. This worked, I was faster on respawn.
Since the speed increased, but I still could sneak and use the sneak glitch, I suspect a bug here.
This does neither work in 0.4.9 nor in b8343cd11c834fb2613b104418ed08e9fdb1665a.
To reproduce, do the following: Create a new mod folder and copy the following code above into init.lua. Start a new world and enable the mod. Join the world. Die. Respawn. Check how fast you walk and wheather you can sneak and use the sneak glitch.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_on_respawnplayer(function(player)
player:set_physics_override({sneak=false, sneak_glitch=false, speed=4})
end)