mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Server: Fixed panic on extremely high level character login due to exp overflow (#597)
This commit is contained in:
parent
d2f8372447
commit
54de646bb3
@ -104,7 +104,9 @@ impl Exp {
|
||||
}
|
||||
|
||||
pub fn update_maximum(&mut self, level: u32) {
|
||||
self.maximum = Self::EXP_INCREASE_FACTOR + (level * Self::EXP_INCREASE_FACTOR);
|
||||
self.maximum = level
|
||||
.saturating_mul(Self::EXP_INCREASE_FACTOR)
|
||||
.saturating_add(Self::EXP_INCREASE_FACTOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user