Browse Source

flip4clip

expsteal
andy 3 years ago
parent
commit
f6cc869cdc
  1. 7
      src/ship/packet/handler/message.rs

7
src/ship/packet/handler/message.rs

@ -406,6 +406,7 @@ where
// TODO: convenience function for giving exp and checking levelups (un-duplicate code here and `request_exp`)
// TODO: use real errors (Idunnoman)
// TODO: create InventoryError::CannotGetItemHandle or something
#[allow(clippy::too_many_arguments)]
pub async fn player_steals_exp<EG> (id: ClientId,
expsteal: &ExperienceSteal,
entity_gateway: &mut EG,
@ -433,9 +434,7 @@ where
let monster_stats = room.monster_stats.get(&monster.monster).ok_or(ShipError::UnknownMonster(monster.monster))?;
let remaining_exp = monster_stats.exp - monster.stolen_exp[area_client.local_client.id() as usize];
if remaining_exp <= 0 {
Ok(Box::new(None.into_iter()))
} else {
if remaining_exp > 0 {
let char_special_modifier: f32 = if client.character.char_class.is_android() {
if room.mode.difficulty() == crate::ship::room::Difficulty::Ultimate {
0.3
@ -514,6 +513,8 @@ where
entity_gateway.save_character(&client.character).await?;
Ok(exp_pkts)
} else {
Ok(Box::new(None.into_iter()))
}
}
}
Loading…
Cancel
Save