Skip to content

Commit

Permalink
reset pmods and stuff for debug runs only
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Aug 27, 2023
1 parent fabc8ee commit a5c7b8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Etterna/MinaCalc/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,18 @@ Calc::InitializeHands(const std::vector<NoteInfo>& NoteInfo,
auto t_keycount = keycount_defined ? keycount : 0u;
auto& all_consuming_ulbu = ulbu_collective.at(t_keycount);

// if debug, force params to load
if (debugmode || loadparams)
// if debug, force params to load and reset pmods and base diffs
if (debugmode || loadparams) {
all_consuming_ulbu->load_calc_params_from_disk(true);
for (const auto& hand : both_hands) {
for (auto& v : pmod_vals.at(hand)) {
std::fill(v.begin(), v.end(), 1.F);
}
for (auto& v : init_base_diff_vals.at(hand)) {
std::fill(v.begin(), v.end(), 0.F);
}
}
}

// reset ulbu patternmod structs
// run agnostic patternmod/sequence loop
Expand Down
2 changes: 2 additions & 0 deletions src/Etterna/MinaCalc/UlbuBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ struct Bazoinkazoink
return pmods;
}

/// these are the base diffs which actually must be reset
/// between calc runs or else things break
void reset_base_diffs()
{
for (auto& hand : both_hands) {
Expand Down

0 comments on commit a5c7b8e

Please sign in to comment.