Browse Source

rebase sillyness

pull/134/head
andy 2 years ago
parent
commit
b012692505
  1. 4
      src/ship/items/tasks.rs
  2. 6
      src/ship/packet/handler/message.rs
  3. 5
      tests/test_item_pickup.rs

4
src/ship/items/tasks.rs

@ -509,8 +509,8 @@ where
}) })
} }
pub async fn floor_item_limit_reached<'a, EG> (
item_state: &'a mut ItemState,
pub fn floor_item_limit_reached<'a, EG> (
item_state: &'a ItemState,
entity_gateway: &'a mut EG, entity_gateway: &'a mut EG,
character: &'a CharacterEntity, character: &'a CharacterEntity,
item_id: &'a ClientItemId, item_id: &'a ClientItemId,

6
src/ship/packet/handler/message.rs

@ -519,9 +519,9 @@ where
clients.with(id, |client| { clients.with(id, |client| {
let mut entity_gateway = entity_gateway.clone(); let mut entity_gateway = entity_gateway.clone();
let mut item_state = item_state.clone();
let item_state = item_state.clone();
Box::pin(async move { Box::pin(async move {
floor_item_limit_reached(&mut item_state, &mut entity_gateway, &client.character, &ClientItemId(floor_item_limit_delete.item_id), map_area).await
floor_item_limit_reached(&item_state, &mut entity_gateway, &client.character, &ClientItemId(floor_item_limit_delete.item_id), map_area).await
})}).await??; })}).await??;
Ok(Vec::new()) Ok(Vec::new())
}
}

5
tests/test_item_pickup.rs

@ -262,6 +262,7 @@ async fn test_pick_up_meseta_when_inventory_full() {
room: 0, room: 0,
x: 0.0, x: 0.0,
z: 0.0, z: 0.0,
amount: 23,
})))).await.unwrap(); })))).await.unwrap();
ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem { ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem {
@ -486,6 +487,7 @@ async fn test_can_not_drop_more_meseta_than_is_held() {
room: 0, room: 0,
x: 0.0, x: 0.0,
z: 0.0, z: 0.0,
amount: 301,
})))).await.unwrap(); })))).await.unwrap();
let split_attempt = ship.handle(ClientId(1), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem { let split_attempt = ship.handle(ClientId(1), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem {
@ -604,6 +606,7 @@ async fn test_can_not_pick_up_meseta_when_full() {
room: 0, room: 0,
x: 0.0, x: 0.0,
z: 0.0, z: 0.0,
amount: 23,
})))).await.unwrap(); })))).await.unwrap();
ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem { ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem {
@ -658,6 +661,7 @@ async fn test_meseta_caps_at_999999_when_trying_to_pick_up_more() {
room: 0, room: 0,
x: 0.0, x: 0.0,
z: 0.0, z: 0.0,
amount: 23,
})))).await.unwrap(); })))).await.unwrap();
ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem { ship.handle(ClientId(2), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem {
@ -722,6 +726,7 @@ async fn test_player_drops_partial_stack_and_other_player_picks_it_up() {
room: 0, room: 0,
x: 0.0, x: 0.0,
z: 0.0, z: 0.0,
amount: 2,
})))).await.unwrap(); })))).await.unwrap();
ship.handle(ClientId(1), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem { ship.handle(ClientId(1), RecvShipPacket::Message(Message::new(GameMessage::PlayerNoLongerHasItem(PlayerNoLongerHasItem {

Loading…
Cancel
Save