]> git.earman.xyz Git - sensor-watch.git/commitdiff
Bugfix on elements not resetting when winning or losing
authorDavid Volovskiy <devolov@gmail.com>
Mon, 19 Aug 2024 04:13:18 +0000 (00:13 -0400)
committerDavid Volovskiy <devolov@gmail.com>
Tue, 3 Sep 2024 20:11:54 +0000 (16:11 -0400)
movement/watch_faces/complication/wordle_face.c

index f5b69a6d7d1466438222550c24ab262da3110aff..35953bb54f9755bf40a96d5383bb246dc4994443 100644 (file)
@@ -502,7 +502,7 @@ static void get_result(wordle_state_t *state) {
     state->guessed_words[state->attempt] = in_dict;
     bool exact_match = check_word(state);
     if (exact_match) {
-        state->attempt = 0;
+        reset_all_elements(state);
         state->curr_screen = SCREEN_WIN;
         if (state->streak < 0x7F)
             state->streak++;
@@ -512,7 +512,7 @@ static void get_result(wordle_state_t *state) {
         return;
     }
     if (++state->attempt >= WORDLE_MAX_ATTEMPTS) {
-        state->attempt = 0;
+        reset_all_elements(state);
         state->curr_screen = SCREEN_LOSE;
         state->streak = 0;
         return;
@@ -560,7 +560,7 @@ void wordle_face_activate(movement_settings_t *settings, void *context) {
 #if USE_DAILY_STREAK
     uint32_t now = get_day_unix_time() ;
     if (state->prev_day <= (now + (60 *60 * 24))) state->streak = 0;
-    if (state->curr_day != now) state->attempt = 0;
+    if (state->curr_day != now) reset_all_elements(state);
 #endif
     state->using_random_guess = false;
     if (is_playing(state) && state->curr_screen >= SCREEN_RESULT) {