Skip to content

Commit bb0399c

Browse files
committed
make mutable world access params register write_all
1 parent a6808f3 commit bb0399c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/bevy_ecs/src/system/system_param.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ unsafe impl SystemParam for &'_ World {
10751075
}
10761076
}
10771077

1078-
const MUT_DEFERRED_WORLD_ERROR: &str = "DeferredWorld requires exclusive access
1078+
const MUT_DEFERRED_WORLD_ERROR: &str = "DeferredWorld requires exclusive access \
10791079
to the entire world, but a previous system parameter already registered \
10801080
access to a part of it. Allowing this would break Rust's mutability rules";
10811081

@@ -1087,6 +1087,7 @@ unsafe impl<'w> SystemParam for DeferredWorld<'w> {
10871087
fn init_state(_world: &mut World, system_meta: &mut SystemMeta) -> Self::State {
10881088
let mut access = Access::default();
10891089
access.read_all();
1090+
access.write_all();
10901091
if !system_meta
10911092
.archetype_component_access
10921093
.is_compatible(&access)
@@ -1098,6 +1099,7 @@ unsafe impl<'w> SystemParam for DeferredWorld<'w> {
10981099
let mut filtered_access = FilteredAccess::default();
10991100

11001101
filtered_access.read_all();
1102+
filtered_access.write_all();
11011103
if !system_meta
11021104
.component_access_set
11031105
.get_conflicts_single(&filtered_access)
@@ -1135,6 +1137,7 @@ unsafe impl SystemParam for &mut World {
11351137
fn init_state(_world: &mut World, system_meta: &mut SystemMeta) -> Self::State {
11361138
let mut access = Access::default();
11371139
access.read_all();
1140+
access.write_all();
11381141
if !system_meta
11391142
.archetype_component_access
11401143
.is_compatible(&access)
@@ -1146,6 +1149,7 @@ unsafe impl SystemParam for &mut World {
11461149
let mut filtered_access = FilteredAccess::default();
11471150

11481151
filtered_access.read_all();
1152+
filtered_access.write_all();
11491153
if !system_meta
11501154
.component_access_set
11511155
.get_conflicts_single(&filtered_access)

0 commit comments

Comments
 (0)