From 4c72b3d11eaa42af4b99ccf9ea729306e589ada8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kat=20March=C3=A1n?= <kzm@zkat.tech>
Date: Fri, 14 Jan 2022 22:09:22 -0800
Subject: [PATCH] feat(thinker): stop cancelling actions when they go under
 Picker thresholds

This allows for easier continuous actions, and I think is more intuitive
---
 src/thinker.rs | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/src/thinker.rs b/src/thinker.rs
index 78fc5b0..5c6db64 100644
--- a/src/thinker.rs
+++ b/src/thinker.rs
@@ -258,23 +258,6 @@ pub fn thinker_system(
                         &default_action_ent,
                         &mut action_states,
                     );
-                } else if let Some(current) = &mut thinker.current_action {
-                    // If we didn't pick anything, and there's no default action,
-                    // we need to see if there's any action currently executing,
-                    // and cancel it. We also use this opportunity to clean up
-                    // stale action components so they don't slow down joins.
-                    let mut state = action_states.get_mut(current.0.0).expect("Couldn't find a component corresponding to the current action. This is definitely a bug.");
-                    match *state {
-                        actions::ActionState::Init
-                        | actions::ActionState::Success
-                        | actions::ActionState::Failure => {
-                            cmd.entity(current.0 .0).despawn_recursive();
-                            thinker.current_action = None;
-                        }
-                        _ => {
-                            *state = ActionState::Cancelled;
-                        }
-                    }
                 }
             }
         }
-- 
GitLab