Skip to content

Commit

Permalink
expression style
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecificProtagonist committed Jan 11, 2025
1 parent 2e894a0 commit edf8299
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ categories = ["game-engines", "data-structures"]
rust-version = "1.83.0"

[features]
default = ["std", "bevy_reflect", "async_executor"]
default = ["std", "bevy_reflect", "async_executor", "track_location"]

# Functionality

Expand Down
19 changes: 8 additions & 11 deletions crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -986,17 +986,14 @@ impl Entities {
&self,
entity: Entity,
) -> Option<&'static Location<'static>> {
self.meta.get(entity.index() as usize).and_then(|meta| {
// Generation is incremented immediately upon despawn
if (meta.generation == entity.generation)
| (meta.location.archetype_id == ArchetypeId::INVALID)
& (meta.generation == IdentifierMask::inc_masked_high_by(entity.generation, 1))
{
meta.spawned_or_despawned_by
} else {
None
}
})
self.meta
.get(entity.index() as usize)
.filter(|meta|
// Generation is incremented immediately upon despawn
(meta.generation == entity.generation)
|| (meta.location.archetype_id == ArchetypeId::INVALID)
&& (meta.generation == IdentifierMask::inc_masked_high_by(entity.generation, 1)))
.and_then(|meta| meta.spawned_or_despawned_by)
}

/// Constructs a message explaining why an entity does not exists, if known.
Expand Down

0 comments on commit edf8299

Please sign in to comment.