impl grinders, fix mag pbs, fix bank thing, etc #128

Merged
jake merged 12 commits from use_grinders into master 2023-02-02 11:37:58 -05:00
Showing only changes of commit 0d3161e1b4 - Show all commits

View File

@ -5,6 +5,7 @@ use async_std::sync::Arc;
use std::future::Future; use std::future::Future;
use std::pin::Pin; use std::pin::Pin;
use std::iter::IntoIterator; use std::iter::IntoIterator;
use anyhow::Context;
use libpso::packet::{ship::Message, messages::GameMessage}; use libpso::packet::{ship::Message, messages::GameMessage};
use crate::ship::map::MapArea; use crate::ship::map::MapArea;
@ -112,7 +113,8 @@ where
let mut inventory = item_state.inventory(&character_id).await?; let mut inventory = item_state.inventory(&character_id).await?;
let item = inventory.remove_item(&item_id, amount) let item = inventory.remove_item(&item_id, amount)
.await .await
.ok_or_else(|| ItemStateError::NoInventoryItem(item_id))?; .ok_or_else(|| ItemStateError::NoInventoryItem(item_id))
.with_context(|| format!("{inventory:#?}"))?;
transaction.gateway().set_character_inventory(&character_id, &inventory.as_inventory_entity(&character_id)).await?; transaction.gateway().set_character_inventory(&character_id, &inventory.as_inventory_entity(&character_id)).await?;
item_state.set_inventory(inventory).await; item_state.set_inventory(inventory).await;