Skip to content
Snippets Groups Projects
Unverified Commit 037a7c0d authored by Kat Marchán's avatar Kat Marchán
Browse files

fix(thinker): Need to do proper ptr_eq comparison here

parent 64f38ce8
No related branches found
No related tags found
No related merge requests found
......@@ -54,11 +54,11 @@ impl ActionState {
pub(crate) struct ActionBuilderId;
#[derive(Debug, Clone)]
pub(crate) struct ActionBuilderWrapper(pub ActionBuilderId, pub Arc<dyn ActionBuilder>);
pub(crate) struct ActionBuilderWrapper(pub Arc<ActionBuilderId>, pub Arc<dyn ActionBuilder>);
impl ActionBuilderWrapper {
pub fn new(builder: Arc<dyn ActionBuilder>) -> Self {
ActionBuilderWrapper(ActionBuilderId, builder)
ActionBuilderWrapper(Arc::new(ActionBuilderId), builder)
}
}
......
......@@ -310,7 +310,7 @@ fn exec_picked_action(
// oscillation protection so we're not just bouncing back and
// forth between the same couple of actions.
if let Some((action_ent, ActionBuilderWrapper(current_id, _))) = &mut thinker.current_action {
if *current_id != picked_action.0 {
if !Arc::ptr_eq(current_id, &picked_action.0) {
// So we've picked a different action than we were
// currently executing. Just like before, we grab the
// actual Action component (and we assume it exists).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment