From 00f56859947758534ba95e93a12160f1b35abb5a Mon Sep 17 00:00:00 2001 From: Nobody Date: Mon, 21 Feb 2022 00:19:53 +0500 Subject: [PATCH] Use new retrieval function and add useful comments --- src/subsystems/entity_subsystem/entity_subsystem.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/subsystems/entity_subsystem/entity_subsystem.rs b/src/subsystems/entity_subsystem/entity_subsystem.rs index 1f129b5..1f777a2 100644 --- a/src/subsystems/entity_subsystem/entity_subsystem.rs +++ b/src/subsystems/entity_subsystem/entity_subsystem.rs @@ -92,8 +92,8 @@ impl Player { }; let spawn_list: Vec> = block.entities.iter() - .filter(|(entity_id, entity)| !spawned_list.contains(entity_id)) - .filter(|(entity_id, entity)| entity.pos().sub(&self.pos).len() < Self::SPAWN_DISTANCE) + .filter(|(entity_id, entity)| !spawned_list.contains(entity_id)) // If entity isn't spawned already... + .filter(|(entity_id, entity)| entity.pos().sub(&self.pos).len() < Self::SPAWN_DISTANCE) // ... and is close enough .map(|(entity_id, entity)| (*entity).clone()) .collect(); @@ -104,7 +104,7 @@ impl Player { sent_ms: TimeManager::timestamp(), client_sequence_id: 0, }); - let world_level = self.db_manager.get_player_prop(self.player_id, proto::PropType::PropPlayerWorldLevel as u32).unwrap() as u32; // TODO: hardcoded value! + let world_level = self.db_manager.get_player_world_level(self.player_id).unwrap() as u32; // TODO: hardcoded value! build_and_send!(self, player_id, metadata, SceneEntityAppearNotify { entity_list: spawn_list.iter().map(|e| e.convert(world_level, &self.json_manager, &self.db_manager)).collect(),