redo this cause entitygateway isnt Clone anymore
This commit is contained in:
parent
3c62587e7e
commit
283688832b
@ -257,34 +257,37 @@ async fn new_character<EG: EntityGateway>(entity_gateway: &mut EG, user: &UserAc
|
|||||||
character_id: character.id,
|
character_id: character.id,
|
||||||
}).await?;
|
}).await?;
|
||||||
|
|
||||||
let (monomates, monofluids) = futures::future::join_all((0..4usize).map(|_| {
|
let mut monomates = Vec::new();
|
||||||
let mut eg = entity_gateway.clone();
|
for _ in 0..4usize {
|
||||||
let character_id = character.id;
|
let monomate = entity_gateway.create_item(
|
||||||
async move {
|
|
||||||
let monomate = eg.create_item(
|
|
||||||
NewItemEntity {
|
NewItemEntity {
|
||||||
item: ItemDetail::Tool (
|
item: ItemDetail::Tool (
|
||||||
Tool {
|
Tool {
|
||||||
tool: item::tool::ToolType::Monomate,
|
tool: item::tool::ToolType::Monomate,
|
||||||
})}).await?;
|
})}).await?;
|
||||||
|
|
||||||
eg.add_item_note(&monomate.id, ItemNote::CharacterCreation {
|
entity_gateway.add_item_note(&monomate.id, ItemNote::CharacterCreation {
|
||||||
character_id
|
character_id: character.id
|
||||||
}).await?;
|
}).await?;
|
||||||
|
|
||||||
let monofluid = eg.create_item(
|
monomates.push(monomate);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut monofluids = Vec::new();
|
||||||
|
for _ in 0..4usize {
|
||||||
|
let monofluid = entity_gateway.create_item(
|
||||||
NewItemEntity {
|
NewItemEntity {
|
||||||
item: ItemDetail::Tool (
|
item: ItemDetail::Tool (
|
||||||
Tool {
|
Tool {
|
||||||
tool: item::tool::ToolType::Monofluid,
|
tool: item::tool::ToolType::Monofluid,
|
||||||
})}).await?;
|
})}).await?;
|
||||||
|
|
||||||
eg.add_item_note(&monofluid.id, ItemNote::CharacterCreation {
|
entity_gateway.add_item_note(&monofluid.id, ItemNote::CharacterCreation {
|
||||||
character_id
|
character_id: character.id
|
||||||
}).await?;
|
}).await?;
|
||||||
|
|
||||||
Ok((monomate, monofluid))
|
monofluids.push(monofluid);
|
||||||
}})).await.into_iter().collect::<Result<Vec<_>, GatewayError>>()?.into_iter().unzip();
|
}
|
||||||
|
|
||||||
let inventory = InventoryEntity {
|
let inventory = InventoryEntity {
|
||||||
items: vec![InventoryItemEntity::Individual(weapon.clone()), InventoryItemEntity::Individual(armor.clone()), InventoryItemEntity::Individual(mag.clone()),
|
items: vec![InventoryItemEntity::Individual(weapon.clone()), InventoryItemEntity::Individual(armor.clone()), InventoryItemEntity::Individual(mag.clone()),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user