-
Notifications
You must be signed in to change notification settings - Fork 72
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
Random welcome fix 1637 #1645
base: main
Are you sure you want to change the base?
Random welcome fix 1637 #1645
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -256,7 +256,8 @@ void Output::print_local_file(const std::string& data) { | |
|
||
bool Output::printfile_random(const std::string& data) { | ||
const printfile_opts opts(sess(), *this, data, true, true); | ||
const auto& dir = sess().dirs().current_menu_gfiles_directory(); | ||
// const auto& dir = sess().dirs().current_menu_gfiles_directory(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what will this break? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you can nix this. currently printfile_random and printfile default to using gfiles/menus/wwiv/gfiles/, which permits multiple menu configs. i was simplifying to just use gfiles/ directly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you think the right behavior here is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check the current_menu_gfiles_directory() first if the file exists there, then check gfiles directory... i'll rework this. |
||
const auto& dir = sess().dirs().gfiles_directory(); | ||
const auto base_fn = opts.data(); | ||
if (const auto dot_zero = FilePath(dir, StrCat(base_fn, ".0")); !File::Exists(dot_zero)) { | ||
return false; | ||
|
@@ -269,7 +270,7 @@ bool Output::printfile_random(const std::string& data) { | |
break; | ||
} | ||
} | ||
return printfile_path(FilePath(dir, StrCat(base_fn, ".", os::random_number(screens))), | ||
return printfile_path(FilePath(dir, StrCat(base_fn, ".", os::random_number(screens-1))), | ||
opts.abortable, opts.force_pause); | ||
} | ||
|
||
|
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.
I bet these two can be collapsed somehow, also isn't this already in an "if (i)" block?
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.
in prior section of code, "i = 0" can make this next section not fire off.