-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix demoserver max_wait skips happening even when they're not supposed to #680
Conversation
…m skips that make no sense actually comment this piece of code
…e for each packet, allowing you to visualize wait packets.
clang-tidy review says "All clean, LGTM! 👍" |
{ | ||
bool ok; | ||
int toggle = args.at(1).toInt(&ok); | ||
if (ok && (toggle == 0 || toggle == 1)) { |
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.
ok
variable is redundant as toggle
would be -1 on error and that is already checked by your if statement
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.
wouldn't .at(1) cause an error if args size is less than 1, rather than returning -1?
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.
args.size() > 1
holds true in this branch of code so it will not fail
also i'm clearly losing brain cells because toInt() returns 0 on failure, not -1. so actually it is not redundant
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
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.
clang-tidy made some suggestions
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
clang-tidy review says "All clean, LGTM! 👍" |
{ | ||
bool ok; | ||
int toggle = args.at(1).toInt(&ok); | ||
if (ok && (toggle == 0 || toggle == 1)) { |
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.
args.size() > 1
holds true in this branch of code so it will not fail
also i'm clearly losing brain cells because toInt() returns 0 on failure, not -1. so actually it is not redundant
Fix demoserver max_wait logic being absolutely bonkers, causing random skips that make no sense, and actually comment this piece of code.
.demo reference used: https://cdn.discordapp.com/attachments/278576491191599104/949242991917301780/tech_support.demo
Also adds a
/debug
command./debug 1
enables debug mode,/debug 0
disables it. What it does is show you the current duration before next playback() call, allowing you to visualize wait packets, tweak delays while editing demo, etc.