more info on incorrect tool usage
This commit is contained in:
		
							parent
							
								
									7144ede73f
								
							
						
					
					
						commit
						1fb0abce09
					
				| @ -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) | ||||
|             }) | ||||
| 
 | ||||
|     } | ||||
|     
 | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user