Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't crash when placing blocks with gameplay enabled #430

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion save/gen-protos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ edition = "2021"
publish = false

[dependencies]
prost-build = "0.13.1"
prost-build = "0.13.3"
4 changes: 2 additions & 2 deletions save/src/protos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ impl ComponentType {
/// (if the ProtoBuf definition does not change) and safe for programmatic use.
pub fn as_str_name(&self) -> &'static str {
match self {
ComponentType::Position => "POSITION",
ComponentType::Name => "NAME",
Self::Position => "POSITION",
Self::Name => "NAME",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
Expand Down
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