use libpso::packet::messages::*; use crate::ship::ship::{ShipError}; use crate::ship::items::{ActiveItemOnFloor}; use std::convert::TryInto; pub fn item_drop(client: u8, target: u8, item_drop: &ActiveItemOnFloor) -> Result { let item_bytes = item_drop.item.as_client_bytes(); Ok(ItemDrop { client: client, target: target, area: item_drop.map_area.area_value(), variety: 0, unknown: 0, x: item_drop.x, z: item_drop.z, y: item_drop.y, item_bytes: item_bytes[0..12].try_into()?, item_id: item_drop.item.id.0, item_bytes2: item_bytes[12..16].try_into()?, unknown2: 0, }) }