From 38d2ba5d84940e565f45ddf552dba06332a435b2 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 3 Aug 2021 23:04:23 +0000 Subject: [PATCH] Fix agent-less pets --- server/src/pet.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/pet.rs b/server/src/pet.rs index ffef6cc3d9..921a628950 100644 --- a/server/src/pet.rs +++ b/server/src/pet.rs @@ -49,7 +49,10 @@ fn tame_pet_internal(ecs: &specs::World, pet_entity: Entity, owner: Entity, pet: .write_storage() .insert(pet_entity, pet.unwrap_or_default()); - if let Some(agent) = ecs.write_storage::().get_mut(pet_entity) { + if let Some(agent) = ecs + .write_storage::() + .get_mut_or_default(pet_entity) + { agent.set_no_flee(); }