-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Fix DetectChanges::last_changed
returning the wrong tick
#7560
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alice-i-cecile
added
C-Bug
An unexpected or incorrect behavior
A-ECS
Entities, components, systems, and events
labels
Feb 8, 2023
This is an incomplete sentence fragment. |
chrisjuchem
force-pushed
the
juchem/fix_last_changed
branch
from
February 9, 2023 02:42
8c2bced
to
4d3611c
Compare
alice-i-cecile
approved these changes
Feb 9, 2023
JoJoJet
approved these changes
Feb 9, 2023
alice-i-cecile
added
the
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
label
Feb 9, 2023
bors r+ |
bors bot
pushed a commit
that referenced
this pull request
Feb 9, 2023
# Objective Make `last_changed` behave as described in its docs. ## Solution - Return `changed` instead of `last_change_tick`. `last_change_tick` is the system's previous tick and is just used for comparison. - Update the docs of the similarly named `set_last_changed` (which does correctly interact with `last_change_tick`) to clarify that the two functions touch different data. (I advocate for renaming one or the other if anyone has any good suggestions). It also might make sense to return a cloned `Tick` instead of `u32`. --- ## Changelog - Fixed `DetectChanges::last_changed` returning the wrong value. - Fixed `DetectChangesMut::set_last_changed` not actually updating the `changed` tick. ## Migration Guide - The incorrect value that was being returned by `DetectChanges::last_changed` was the previous run tick of the system checking for changed values. If you depended on this value, you can get it from the `SystemChangeTick` `SystemParam` instead.
bors
bot
changed the title
Fix
[Merged by Bors] - Fix Feb 9, 2023
DetectChanges::last_changed
returning the wrong tickDetectChanges::last_changed
returning the wrong tick
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 11, 2023
…e#7560) # Objective Make `last_changed` behave as described in its docs. ## Solution - Return `changed` instead of `last_change_tick`. `last_change_tick` is the system's previous tick and is just used for comparison. - Update the docs of the similarly named `set_last_changed` (which does correctly interact with `last_change_tick`) to clarify that the two functions touch different data. (I advocate for renaming one or the other if anyone has any good suggestions). It also might make sense to return a cloned `Tick` instead of `u32`. --- ## Changelog - Fixed `DetectChanges::last_changed` returning the wrong value. - Fixed `DetectChangesMut::set_last_changed` not actually updating the `changed` tick. ## Migration Guide - The incorrect value that was being returned by `DetectChanges::last_changed` was the previous run tick of the system checking for changed values. If you depended on this value, you can get it from the `SystemChangeTick` `SystemParam` instead.
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 11, 2023
…e#7560) # Objective Make `last_changed` behave as described in its docs. ## Solution - Return `changed` instead of `last_change_tick`. `last_change_tick` is the system's previous tick and is just used for comparison. - Update the docs of the similarly named `set_last_changed` (which does correctly interact with `last_change_tick`) to clarify that the two functions touch different data. (I advocate for renaming one or the other if anyone has any good suggestions). It also might make sense to return a cloned `Tick` instead of `u32`. --- ## Changelog - Fixed `DetectChanges::last_changed` returning the wrong value. - Fixed `DetectChangesMut::set_last_changed` not actually updating the `changed` tick. ## Migration Guide - The incorrect value that was being returned by `DetectChanges::last_changed` was the previous run tick of the system checking for changed values. If you depended on this value, you can get it from the `SystemChangeTick` `SystemParam` instead.
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 14, 2023
…ngine#7619) # Objective Continuation of bevyengine#7560. `MutUntyped::last_changed` and `set_last_changed` do not behave as described in their docs. ## Solution Fix them using the same approach that was used for `Mut<>` in bevyengine#7560.
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 15, 2023
…e#7560) # Objective Make `last_changed` behave as described in its docs. ## Solution - Return `changed` instead of `last_change_tick`. `last_change_tick` is the system's previous tick and is just used for comparison. - Update the docs of the similarly named `set_last_changed` (which does correctly interact with `last_change_tick`) to clarify that the two functions touch different data. (I advocate for renaming one or the other if anyone has any good suggestions). It also might make sense to return a cloned `Tick` instead of `u32`. --- ## Changelog - Fixed `DetectChanges::last_changed` returning the wrong value. - Fixed `DetectChangesMut::set_last_changed` not actually updating the `changed` tick. ## Migration Guide - The incorrect value that was being returned by `DetectChanges::last_changed` was the previous run tick of the system checking for changed values. If you depended on this value, you can get it from the `SystemChangeTick` `SystemParam` instead.
myreprise1
pushed a commit
to myreprise1/bevy
that referenced
this pull request
Feb 15, 2023
…ngine#7619) # Objective Continuation of bevyengine#7560. `MutUntyped::last_changed` and `set_last_changed` do not behave as described in their docs. ## Solution Fix them using the same approach that was used for `Mut<>` in bevyengine#7560.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ECS
Entities, components, systems, and events
C-Bug
An unexpected or incorrect behavior
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
Make
last_changed
behave as described in its docs.Solution
changed
instead oflast_change_tick
.last_change_tick
is the system's previous tick and is just used for comparison.set_last_changed
(which does correctly interact withlast_change_tick
) to clarify that the two functions touch different data. (I advocate for renaming one or the other if anyone has any good suggestions).It also might make sense to return a cloned
Tick
instead ofu32
.Changelog
DetectChanges::last_changed
returning the wrong value.DetectChangesMut::set_last_changed
not actually updating thechanged
tick.Migration Guide
DetectChanges::last_changed
was the previous run tick of the system checking for changed values. If you depended on this value, you can get it from theSystemChangeTick
SystemParam
instead.