Skip to content

Commit

Permalink
Move current_twist_angle_ reset to make more sense. (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
NoSloppy authored Nov 26, 2024
1 parent 10d2998 commit 556c15d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion props/saber_BC_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,10 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {

if (a < -M_PI / 3) {
CheckSavedTwist(EVENT_TWIST_LEFT);
current_twist_angle_ = fusor.angle2();
} else if (a > M_PI / 3) {
CheckSavedTwist(EVENT_TWIST_RIGHT);
current_twist_angle_ = fusor.angle2();
}
}

Expand All @@ -1564,7 +1566,6 @@ class SaberBCButtons : public PROP_INHERIT_PREFIX PropBase {
// Trigger the saved twist after timeout
PVLOG_DEBUG << (saved_twist_ == EVENT_TWIST_LEFT ? "**** Doing SAVED TWIST LEFT\n" : "Doing SAVED TWIST RIGHT\n");
Event(BUTTON_NONE, (EVENT)saved_twist_);
current_twist_angle_ = fusor.angle2();
// Clear the twist state and reset strokes to prevent Normal Twist after USER twist
DoGesture(TWIST_CLOSE);
saved_twist_ = 0;
Expand Down

0 comments on commit 556c15d

Please sign in to comment.