fixes 0/negative mana regen
This commit is contained in:
parent
0ff9c1000b
commit
f8c74ea6f9
1 changed files with 2 additions and 1 deletions
|
|
@ -85,11 +85,12 @@ fn try_hp_regen_tick(pool: &mut Pools, amount: i32) {
|
|||
}
|
||||
|
||||
fn get_mana_regen_per_tick(e: Entity, attributes: &ReadStorage<Attributes>) -> i32 {
|
||||
return if let Some(attributes) = attributes.get(e) {
|
||||
let regen = if let Some(attributes) = attributes.get(e) {
|
||||
((attributes.intelligence.bonus + attributes.wisdom.bonus) / 2) + MIN_MP_REGEN_PER_TURN
|
||||
} else {
|
||||
MIN_MP_REGEN_PER_TURN
|
||||
};
|
||||
return i32::max(regen, 1);
|
||||
}
|
||||
|
||||
fn try_mana_regen_tick(pool: &mut Pools, amount: i32) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue