remove unwrap
This commit is contained in:
parent
72141ace2c
commit
5e9a94081c
@ -26,7 +26,7 @@ pub async fn request_exp<EG: EntityGateway>(id: ClientId,
|
||||
.ok_or_else(|| ShipError::InvalidRoom(room_id.0 as u32))?;
|
||||
|
||||
let monster = room.maps.enemy_by_id(request_exp.enemy_id as usize)?;
|
||||
let monster_stats = room.monster_stats.get(&monster.monster).unwrap();
|
||||
let monster_stats = room.monster_stats.get(&monster.monster).ok_or(ShipError::UnknownMonster(monster.monster.clone()))?;
|
||||
|
||||
let exp_gain = if request_exp.last_hitter == 1 {
|
||||
monster_stats.exp
|
||||
|
@ -66,6 +66,7 @@ pub enum ShipError {
|
||||
NotEnoughMeseta(ClientId, u32),
|
||||
ShopError,
|
||||
GatewayError(#[from] GatewayError),
|
||||
UnknownMonster(crate::ship::monster::MonsterType),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user