Browse Source

cleanup

pull/124/head
jake 2 years ago
parent
commit
4f8a75f9d7
  1. 6
      src/ship/items/actions.rs
  2. 7
      src/ship/items/apply_item.rs
  3. 3
      src/ship/items/tasks.rs

6
src/ship/items/actions.rs

@ -785,7 +785,6 @@ where
let func1 = Arc::new(func1);
let func2 = Arc::new(func2);
move |(item_state, transaction), input| {
let input = input.clone();
let func1 = func1.clone();
let func2 = func2.clone();
Box::pin(async move {
@ -1106,9 +1105,8 @@ where
let mut character = character.clone();
Box::pin(async move {
for action in apply_item_actions {
match action {
ApplyItemAction::UpdateCharacter(new_character) => character = *new_character,
_ => {}
if let ApplyItemAction::UpdateCharacter(new_character) = action {
character = *new_character
}
}

7
src/ship/items/apply_item.rs

@ -1,12 +1,11 @@
use std::convert::TryInto;
use futures::future::{join_all, BoxFuture, LocalBoxFuture};
use futures::stream::{FuturesOrdered, StreamExt};
use futures::future::join_all;
use thiserror::Error;
use rand::{Rng, SeedableRng};
use rand::SeedableRng;
use rand::distributions::{WeightedIndex, Distribution};
use crate::entity::gateway::{EntityGateway, GatewayError};
use crate::entity::character::CharacterEntity;
use crate::entity::item::mag::{MagType, MagCell, MagCellError};
use crate::entity::item::mag::{MagCell, MagCellError};
use crate::entity::item::tool::{Tool, ToolType};
use crate::entity::item::{ItemDetail, ItemEntityId};
use crate::ship::items::state::{ItemStateProxy, ItemStateError};

3
src/ship/items/tasks.rs

@ -9,7 +9,6 @@ use crate::ship::items::state::{ItemState, ItemStateProxy, ItemStateError, Indiv
use crate::ship::items::itemstateaction::{ItemStateAction, ItemAction};
use crate::ship::items::inventory::InventoryItem;
use crate::ship::items::floor::FloorItem;
use crate::ship::items::apply_item::ApplyItemAction;
use crate::entity::item::ItemModifier;
use crate::ship::shops::ShopItem;
use crate::ship::trade::TradeItem;
@ -283,7 +282,7 @@ where
let item_state_proxy = ItemStateProxy::new(item_state.clone());
let ((item_state_proxy, transaction), (pkts, new_character)) = ItemStateAction::default()
.act(actions::take_item_from_inventory(character.id, *item_id, amount))
.act(actions::use_consumed_item(&character))
.act(actions::use_consumed_item(character))
.act(actions::fork(
actions::foreach(actions::apply_item_action_packets(character.id, area_client)),
actions::apply_item_action_character(character)

Loading…
Cancel
Save