diff --git a/src/ship/packet/builder/lobby.rs b/src/ship/packet/builder/lobby.rs index b0a0d8e..56213dd 100644 --- a/src/ship/packet/builder/lobby.rs +++ b/src/ship/packet/builder/lobby.rs @@ -18,7 +18,7 @@ pub fn join_lobby(id: ClientId, let playerinfo = lobby_clients.iter() .map(|area_client| { let client = clients.get(&area_client.client).ok_or(ShipError::ClientNotFound(area_client.client)).unwrap(); - player_info(0x100, &client, area_client, item_manager, level_table) + player_info(0x100, client, area_client, item_manager, level_table) }); let client = clients.get(&id).ok_or(ShipError::ClientNotFound(id)).unwrap(); @@ -55,7 +55,7 @@ pub fn add_to_lobby(id: ClientId, block: client.block as u16, event: 0, padding: 0, - playerinfo: player_info(0x100, &client, &area_client, item_manager, level_table), + playerinfo: player_info(0x100, client, &area_client, item_manager, level_table), }) } diff --git a/src/ship/packet/builder/message.rs b/src/ship/packet/builder/message.rs index 91d4149..dfe1ac5 100644 --- a/src/ship/packet/builder/message.rs +++ b/src/ship/packet/builder/message.rs @@ -142,8 +142,8 @@ pub fn player_no_longer_has_item(area_client: AreaClient, item_id: ClientItemId, } } -pub fn shop_list(shop_type: u8, items: &Vec) -> ShopList { - let items = items.into_iter() +pub fn shop_list(shop_type: u8, items: &[I]) -> ShopList { + let items = items.iter() .enumerate() .map(|(i, item)| { ShopListItem { diff --git a/src/ship/packet/builder/quest.rs b/src/ship/packet/builder/quest.rs index 089fe56..8078517 100644 --- a/src/ship/packet/builder/quest.rs +++ b/src/ship/packet/builder/quest.rs @@ -22,7 +22,7 @@ pub fn quest_category_list(quests: &QuestList) -> QuestCategoryList { } } -pub fn quest_list(category_id: u32, quests: &Vec) -> QuestOptionList { +pub fn quest_list(category_id: u32, quests: &[Quest]) -> QuestOptionList { let quest_entries = quests.iter() .map(|quest| { QuestEntry { diff --git a/src/ship/packet/builder/room.rs b/src/ship/packet/builder/room.rs index 7dda664..2eb8fc7 100644 --- a/src/ship/packet/builder/room.rs +++ b/src/ship/packet/builder/room.rs @@ -20,7 +20,7 @@ pub fn join_room(id: ClientId, let header_client = clients.get(&c.client).ok_or(ShipError::ClientNotFound(id))?; let header_area_client = client_location.get_local_client(id).map_err(|err| -> ClientLocationError { err.into() })?; acc.map(|mut a| { - a[i] = player_header(0x10000, &header_client, &header_area_client); + a[i] = player_header(0x10000, header_client, &header_area_client); a }) })?; @@ -67,7 +67,7 @@ pub fn add_to_room(_id: ClientId, block: 0, event: 0, padding: 0, - playerinfo: player_info(0x10000, client, &area_client, item_manager, level_table), + playerinfo: player_info(0x10000, client, area_client, item_manager, level_table), }) }