|
|
@ -135,13 +135,26 @@ where |
|
|
|
let dropped_meseta = item_manager.player_drops_meseta_on_shared_floor(entity_gateway, &mut client.character, drop_location, no_longer_has_item.amount as u32).await?;
|
|
|
|
|
|
|
|
let dropped_meseta_pkt = builder::message::drop_split_meseta_stack(area_client, &dropped_meseta)?;
|
|
|
|
let no_longer_has_meseta_pkt = builder::message::player_no_longer_has_meseta(area_client, no_longer_has_item.amount as u32);
|
|
|
|
client.item_drop_location = None;
|
|
|
|
|
|
|
|
let clients_in_area = client_location.get_clients_in_room(room_id).map_err(|err| -> ClientLocationError { err.into() })?;
|
|
|
|
Ok(Box::new(clients_in_area.into_iter()
|
|
|
|
.map(move |c| {
|
|
|
|
(c.client, SendShipPacket::Message(Message::new(GameMessage::DropSplitStack(dropped_meseta_pkt.clone()))))
|
|
|
|
})))
|
|
|
|
std::iter::once((c.client, SendShipPacket::Message(Message::new(GameMessage::DropSplitStack(dropped_meseta_pkt.clone())))))
|
|
|
|
.chain(
|
|
|
|
if c.client != id {
|
|
|
|
Box::new(std::iter::once(
|
|
|
|
(c.client, SendShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(no_longer_has_meseta_pkt.clone()))))
|
|
|
|
)) as Box<dyn Iterator<Item = _> + Send>
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Box::new(std::iter::empty()) as Box<dyn Iterator<Item = _> + Send>
|
|
|
|
}
|
|
|
|
)
|
|
|
|
})
|
|
|
|
.flatten()
|
|
|
|
))
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
let dropped_item = item_manager.player_drops_partial_stack_on_shared_floor(entity_gateway, &client.character, drop_location.item_id, drop_location, no_longer_has_item.amount as usize).await?;
|
|
|
|