pithy wrote:I don't like getting stuck on chairs, it makes me feel old.
My furniture mod implements sitting a different way.
I know your mod and I like your mod from the player-side, but I won't add this because it registers another globalstep and globalsteps will make the server slower and slower.
Globalsteps run all the time and that is unnecessary waste of resources (at least in this case).
But I would know a compromise:
Right-click to enter a chair, shift to leave it (completely without globalsteps).
So my idea (for devs):
- a on_rightclick function for chairs that'll let the player sit onto the chair
- after that, we'll start a minetest.after-loop it'll check if the player has pressed the shift key, if so the player will stand up again.
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
function sit_up_on_shift(...)
<check the controls>
if shift_pressed then
sit_up(...)
else
minetest.after(.8, sit_up_on_shift, ...)
end
end
on_rightclick = function(...)
sit_down(...)
sit_up_on_shift(...)
end
What do you think about that?