properly handle an error that doesn't even occur at the moment
This commit is contained in:
		
							parent
							
								
									ac0062260a
								
							
						
					
					
						commit
						d1b62d13d0
					
				| @ -82,6 +82,11 @@ pub enum InventoryItemAddToError { | ||||
|     ExceedsCapacity, | ||||
| } | ||||
| 
 | ||||
| #[derive(Error, Debug, Clone)] | ||||
| #[error("")] | ||||
| pub enum InventoryAddError { | ||||
| } | ||||
| 
 | ||||
| impl InventoryItem { | ||||
|     pub fn entity_ids(&self) -> Vec<ItemEntityId> { | ||||
|         match self { | ||||
| @ -511,7 +516,7 @@ impl CharacterInventory { | ||||
|             .nth(0) | ||||
|     } | ||||
| 
 | ||||
|     pub fn add_item(&mut self, item: InventoryItem) -> Result<(), ()> { // TODO: errors
 | ||||
|     pub fn add_item(&mut self, item: InventoryItem) -> Result<(), InventoryAddError> { // TODO: errors
 | ||||
|         // TODO: check slot conflict?
 | ||||
|         self.items.push(item); | ||||
|         Ok(()) | ||||
|  | ||||
| @ -917,7 +917,7 @@ impl ItemManager { | ||||
|             entity_id: entity_id, | ||||
|             item_id: item_id, | ||||
|             item: ItemDetail::Weapon(weapon.clone()), | ||||
|         })); | ||||
|         }))?; | ||||
| 
 | ||||
|         entity_gateway.set_character_inventory(&character.id, &inventory.as_inventory_entity(&character.id)).await?; | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user