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

Teleport to infinity and NaN! #67

Closed
gabriel-doriath-dohler opened this issue May 15, 2022 · 2 comments · Fixed by #71
Closed

Teleport to infinity and NaN! #67

gabriel-doriath-dohler opened this issue May 15, 2022 · 2 comments · Fixed by #71

Comments

@gabriel-doriath-dohler
Copy link
Contributor

gabriel-doriath-dohler commented May 15, 2022

Coordinates are parsed to IEEE754 floats with Rust's parse method, which allows for infinity, -infinity, inf, -inf, nan and -nan (and is not case-sensitive).

This causes some weird behavior such as:

  • //tp inf 10 inf teleports the player a bit outside the world barrier
  • //tp NaN 10 10 hangs my client (I had to kill my client and delete the player's file to fix it)
  • //tp 0 inf 0 hangs my client (I had to kill my client and delete the player's file to fix it)
@gabriel-doriath-dohler
Copy link
Contributor Author

Relevant documentation on the parsing of floats in Rust:
https://doc.rust-lang.org/std/primitive.f64.html#grammar
with the correction
rust-lang/rust@4c17217

@AL1L
Copy link
Contributor

AL1L commented May 15, 2022

I say keep this as a feature 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants