Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
DetectChanges::last_changed
returning the wrong tick (bevyengin…
…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.
- Loading branch information