-
Notifications
You must be signed in to change notification settings - Fork 426
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
[Crash] Bugfix for zone crash caused by #flymode -1 #1291
Conversation
Fixed typo in the command description.
Bugfix for #flymode zone crash when invalid values are passed. Also, when entering #flymode without parameters, the correct syntax is now displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should just atoi the separator argument and check if >= 0 and <= 5.
I have tried to find the smallest possible change to fix the issue. |
I agree with this
I think just checking IsNumber, atoi, etc is a cleaner fix. Which is better. |
Edit: You'll also need to flip the logic, put the message as the else and this as the part that sends the command. if (strlen(sep->arg[1]) == 1 && sep.IsNumber(1) && atoi(sep->arg[1]) >= 0 && atoi(sep->arg[1]) <= 5)) |
This comment was marked as abuse.
This comment was marked as abuse.
Understood and changed as requested. The PR is tested on my server and works for me. I still have some questions but I will ask them in Discord. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. 👍
Bugfix for zone crash caused by #flymode when invalid values are passed. Also, when #flymode is typed without parameters, the correct syntax is displayed.