mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'xvar/fix-server-crash-on-high-char-lvl-login' into 'master'
Server: Fixed panic on extremely high level character login due to exp overflow (#597) See merge request veloren/veloren!1091
This commit is contained in:
commit
babf452686
@ -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