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

[Crash] Bugfix for zone crash caused by #flymode -1 #1291

Merged
merged 4 commits into from Mar 16, 2021
Merged

[Crash] Bugfix for zone crash caused by #flymode -1 #1291

merged 4 commits into from Mar 16, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 11, 2021

Bugfix for zone crash caused by #flymode when invalid values are passed. Also, when #flymode is typed without parameters, the correct syntax is displayed.

thalix1337 added 3 commits March 7, 2021 16:33
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.
Copy link

@ghost ghost left a 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.

@ghost
Copy link
Author

ghost commented Mar 11, 2021

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.

@mackal
Copy link
Member

mackal commented Mar 11, 2021

Should just atoi the separator argument and check if >= 0 and <= 5.

I agree with this

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 think just checking IsNumber, atoi, etc is a cleaner fix. Which is better.

@ghost
Copy link

ghost commented Mar 11, 2021

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.

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))

@splose

This comment was marked as abuse.

@ghost
Copy link
Author

ghost commented Mar 12, 2021

^ is the best way to make that code smaller the original is pretty awful.

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.

Copy link

@ghost ghost left a 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. 👍

@splose

This comment was marked as abuse.

@Akkadius Akkadius changed the title Bugfix for zone crash caused by #flymode -1 [Crash] Bugfix for zone crash caused by #flymode -1 Mar 16, 2021
@Akkadius Akkadius merged commit 5035451 into EQEmu:master Mar 16, 2021
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 this pull request may close these issues.

3 participants