From 74b937891d226c6da7c2f583e12a02f983ce7fd5 Mon Sep 17 00:00:00 2001 From: Patrick Owen Date: Sat, 5 Oct 2024 16:00:53 -0400 Subject: [PATCH 1/2] Don't crash when placing blocks with gameplay enabled --- server/src/sim.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server/src/sim.rs b/server/src/sim.rs index 08ece64e..b048b520 100644 --- a/server/src/sim.rs +++ b/server/src/sim.rs @@ -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 From 97e9fb29b550e063cbbc0f5474c2cbde6e602c97 Mon Sep 17 00:00:00 2001 From: Patrick Owen Date: Sat, 5 Oct 2024 16:13:05 -0400 Subject: [PATCH 2/2] Update and rerun gen-protos --- save/gen-protos/Cargo.toml | 2 +- save/src/protos.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/save/gen-protos/Cargo.toml b/save/gen-protos/Cargo.toml index 2bbb099f..c26ce914 100644 --- a/save/gen-protos/Cargo.toml +++ b/save/gen-protos/Cargo.toml @@ -5,4 +5,4 @@ edition = "2021" publish = false [dependencies] -prost-build = "0.13.1" +prost-build = "0.13.3" diff --git a/save/src/protos.rs b/save/src/protos.rs index fa03540a..d05816b8 100644 --- a/save/src/protos.rs +++ b/save/src/protos.rs @@ -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.