Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
big-brain
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Louis
big-brain
Commits
037a7c0d
Unverified
Commit
037a7c0d
authored
4 years ago
by
Kat Marchán
Browse files
Options
Downloads
Patches
Plain Diff
fix(thinker): Need to do proper ptr_eq comparison here
parent
64f38ce8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/actions.rs
+2
-2
2 additions, 2 deletions
src/actions.rs
src/thinker.rs
+1
-1
1 addition, 1 deletion
src/thinker.rs
with
3 additions
and
3 deletions
src/actions.rs
+
2
−
2
View file @
037a7c0d
...
...
@@ -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
)
}
}
...
...
This diff is collapsed.
Click to expand it.
src/thinker.rs
+
1
−
1
View file @
037a7c0d
...
...
@@ -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).
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment