aboutsummaryrefslogtreecommitdiff
path: root/azalea/src/pathfinder/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea/src/pathfinder/mod.rs')
-rw-r--r--azalea/src/pathfinder/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index 9fd769e6..360c4df5 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -208,9 +208,11 @@ fn goto_listener(
let thread_pool = AsyncComputeTaskPool::get();
for event in events.read() {
- let (mut pathfinder, executing_path, position, instance_name, inventory) = query
- .get_mut(event.entity)
- .expect("Called goto on an entity that's not in the world");
+ let Ok((mut pathfinder, executing_path, position, instance_name, inventory)) =
+ query.get_mut(event.entity)
+ else {
+ continue;
+ };
if event.goal.success(BlockPos::from(position)) {
// we're already at the goal, nothing to do