Skip to content

Commit

Permalink
Don't crash when placing blocks with gameplay enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
patowen committed Oct 5, 2024
1 parent 8755237 commit 74b9378
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions server/src/sim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,10 @@ impl Sim {
if let Ok(position) = self.world.get::<&Position>(entity) {
self.graph_entities.remove(position.node, entity);
}
self.world.despawn(entity).unwrap();

if !self.world.satisfies::<&InactiveCharacter>(entity).unwrap() {
self.accumulated_changes.despawns.push(id);
}
self.world.despawn(entity).unwrap();
}

/// Collect information about all entities, for transmission to new clients
Expand Down

0 comments on commit 74b9378

Please sign in to comment.