bevy/crates
JoJoJet 7ec89004dd
Only trigger state transitons if next_state != old_state (#8359)
# Objective

Fix #8191.

Currently, a state transition will be triggered whenever the `NextState`
resource has a value, even if that "transition" is to the same state as
the previous one. This caused surprising/meaningless behavior, such as
the existence of an `OnTransition { from: A, to: A }` schedule.

## Solution

State transition schedules now only run if the new state is not equal to
the old state. Change detection works the same way, only being triggered
when the states compare not equal.

---

## Changelog

- State transition schedules are no longer run when transitioning to and
from the same state.

## Migration Guide

State transitions are now only triggered when the exited and entered
state differ. This means that if the world is currently in state `A`,
the `OnEnter(A)` schedule (or `OnExit`) will no longer be run if you
queue up a state transition to the same state `A`.
2023-04-12 17:07:13 +00:00
..
bevy_a11y Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_animation Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_app Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_asset Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_audio Ability to set a Global Volume (#7706) 2023-04-10 14:08:43 +00:00
bevy_core Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_core_pipeline Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_diagnostic Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dylib Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_dynamic_plugin Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_ecs Only trigger state transitons if next_state != old_state (#8359) 2023-04-12 17:07:13 +00:00
bevy_ecs_compile_fail_tests Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_encase_derive Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gilrs Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gizmos Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_gltf Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_hierarchy Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_input Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_internal Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_log Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_macro_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_math Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_mikktspace Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_pbr Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_ptr Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_reflect Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_reflect_compile_fail_tests bevy_reflect: Fix trailing comma breaking derives (#8014) 2023-03-27 21:47:33 +00:00
bevy_render Fix viewport change detection (#8323) 2023-04-10 20:41:32 +00:00
bevy_scene Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_sprite Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_tasks Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_text Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_time Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_transform Fix transform propagation of orphaned entities (#7264) 2023-04-09 20:53:33 +00:00
bevy_ui Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_utils Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00
bevy_window Non-breaking change* from UK spellings to US (#8291) 2023-04-08 16:22:46 +00:00
bevy_winit Suppress the clippy::type_complexity lint (#8313) 2023-04-06 21:27:36 +00:00