Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

player:setpos and player:moveto do not really teleport player when player is sneaking #2876

Closed
Wuzzy2 opened this issue Jul 3, 2015 · 5 comments
Labels
Bug Issues that were confirmed to be a bug @ Server / Client / Env.

Comments

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Jul 3, 2015

If you use player:setpos(some_position) or player:moveto(some_position) on the player object player, the player is not really set to some_position under these conditions:

  • The player is standing on any solid node AND
  • The player is currently sneaking (holding down the sneak key)

The player won't be teleported to the destination, instead the player is just moved to the edge of the node on which the player is currently standing, but interestingly, this is always towards the direction of the destination.

One way to quickly test this is by using the Mirror of Returning (https://forum.minetest.net/viewtopic.php?f=11&t=11224) or Point Teleporter (https://forum.minetest.net/viewtopic.php?f=11&t=9629).
Both mods directly call setpos when you use the item.

I think this is very unexpected for modders, it also seems to me the modder has zero chance to somehow “overwrite” this behaviour or to ignore the sneaking.

Tested in: 0.4.12

@HybridDog
Copy link
Contributor

Does the problem happen to player:moveto(pos), too?

@PilzAdam
Copy link
Contributor

PilzAdam commented Jul 9, 2015

This probably because we keep a reference to the node the player is standing on in the player object. It may be fixable by setting m_sneak_node_exists to false when teleporting.

@PilzAdam PilzAdam added Bug Issues that were confirmed to be a bug @ Server / Client / Env. labels Jul 9, 2015
@Wuzzy2
Copy link
Contributor Author

Wuzzy2 commented Jul 9, 2015

Does the problem happen to player:moveto(pos), too?

Yes.

@Wuzzy2 Wuzzy2 changed the title player:setpos does not really teleport player when player is sneaking player:setpos and player:moveto do not really teleport player when player is sneaking Jul 9, 2015
HybridDog added a commit to HybridDog/minetest that referenced this issue Feb 2, 2016
Only set back position when sneaking if player wasn't teleported by adding and using a bool "got_teleported" to player
it fixes minetest#2876
@paramat
Copy link
Contributor

paramat commented Mar 14, 2016

3535 is merged, hopefully this is fixed.

@BetterToAutomateTheWorld

Thank you for this merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug @ Server / Client / Env.
Projects
None yet
Development

No branches or pull requests

5 participants