Compare commits

...

2 Commits

Author SHA1 Message Date
6ef5ea6681 set mag owner when creating a char
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2023-01-30 15:45:34 -07:00
1fb0abce09 more info on incorrect tool usage 2023-01-30 12:19:41 -07:00
3 changed files with 10 additions and 2 deletions

View File

@ -521,7 +521,7 @@ pub enum MagCellError {
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum MagModifier {
FeedMag{
FeedMag {
food: ItemEntityId,
},
BankMag, // when putting a mag in the bank it truncates the values which has applications when raising degenerate mags

View File

@ -266,6 +266,8 @@ async fn new_character<EG: EntityGateway + Clone>(entity_gateway: &mut EG, user:
character_id: character.id,
}).await?;
entity_gateway.change_mag_owner(&mag.id, &character).await?;
let mut monomates = Vec::new();
for _ in 0..4usize {
let monomate = entity_gateway.create_item(

View File

@ -22,6 +22,8 @@ pub enum ApplyItemError {
ItemNotEquipped,
#[error("could not use item invalid item")]
InvalidItem,
#[error("invalid tool")]
InvalidTool,
#[error("gateway error {0}")]
GatewayError(#[from] GatewayError),
@ -311,7 +313,11 @@ where
}
ToolType::JackOLantern => jack_o_lantern(),
// TODO: rest of these
_ => Err(ApplyItemError::InvalidItem.into())
_ => Err(anyhow::Error::from(ApplyItemError::InvalidTool))
.with_context(|| {
format!("invalid tool {:?}", tool)
})
}
}