|
@ -8,7 +8,6 @@ use std::pin::Pin; |
|
|
use std::iter::IntoIterator;
|
|
|
use std::iter::IntoIterator;
|
|
|
use anyhow::Context;
|
|
|
use anyhow::Context;
|
|
|
|
|
|
|
|
|
use libpso::packet::{ship::Message, messages::GameMessage};
|
|
|
|
|
|
use entity::character::{CharacterEntity, CharacterEntityId};
|
|
|
use entity::character::{CharacterEntity, CharacterEntityId};
|
|
|
use entity::gateway::{EntityGateway, EntityGatewayTransaction};
|
|
|
use entity::gateway::{EntityGateway, EntityGatewayTransaction};
|
|
|
use entity::item::{ItemDetail, NewItemEntity, TradeId, ItemModifier};
|
|
|
use entity::item::{ItemDetail, NewItemEntity, TradeId, ItemModifier};
|
|
@ -22,7 +21,6 @@ use crate::floor::{FloorItem, FloorItemDetail}; |
|
|
use crate::apply_item::{apply_item, ApplyItemAction};
|
|
|
use crate::apply_item::{apply_item, ApplyItemAction};
|
|
|
use shops::ShopItem;
|
|
|
use shops::ShopItem;
|
|
|
use drops::{ItemDrop, ItemDropType};
|
|
|
use drops::{ItemDrop, ItemDropType};
|
|
|
//use crate::ship::packet::builder;
|
|
|
|
|
|
use location::AreaClient;
|
|
|
use location::AreaClient;
|
|
|
use maps::monster::MonsterType;
|
|
|
use maps::monster::MonsterType;
|
|
|
|
|
|
|
|
@ -1166,8 +1164,7 @@ where |
|
|
let (inventory_item_detail, create_item) = if item_detail.is_stackable() {
|
|
|
let (inventory_item_detail, create_item) = if item_detail.is_stackable() {
|
|
|
let tool = item_detail.as_tool().ok_or_else(|| ItemStateError::NotATool(ClientItemId(0xFFFFFFFF)))?;
|
|
|
let tool = item_detail.as_tool().ok_or_else(|| ItemStateError::NotATool(ClientItemId(0xFFFFFFFF)))?;
|
|
|
|
|
|
|
|
|
//let create_item = builder::message::create_stacked_item(area_client, item_id, &tool, 1).map_err(|_err| ItemStateError::Dummy)?;
|
|
|
|
|
|
let create_item = CreateItem::Stacked(area_client, item_id, tool.clone(), 1);
|
|
|
|
|
|
|
|
|
let create_item = CreateItem::Stacked(area_client, item_id, tool, 1);
|
|
|
let item_detail = StackedItemDetail {
|
|
|
let item_detail = StackedItemDetail {
|
|
|
entity_ids: vec![new_item.id],
|
|
|
entity_ids: vec![new_item.id],
|
|
|
tool
|
|
|
tool
|
|
@ -1179,7 +1176,6 @@ where |
|
|
entity_id: new_item.id,
|
|
|
entity_id: new_item.id,
|
|
|
item: item_detail,
|
|
|
item: item_detail,
|
|
|
};
|
|
|
};
|
|
|
//let create_item = builder::message::create_individual_item(area_client, item_id, &item_detail).map_err(|_err| ItemStateError::Dummy)?;
|
|
|
|
|
|
let create_item = CreateItem::Individual(area_client, item_id, item_detail.clone());
|
|
|
let create_item = CreateItem::Individual(area_client, item_id, item_detail.clone());
|
|
|
(InventoryItemDetail::Individual(item_detail), create_item)
|
|
|
(InventoryItemDetail::Individual(item_detail), create_item)
|
|
|
};
|
|
|
};
|
|
|