Fix demoserver max_wait skips happening even when they're not supposed to#680
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.
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.
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.
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>
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.
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
/debugcommand./debug 1enables debug mode,/debug 0disables 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.