mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Address review comments
This commit is contained in:
parent
374bd10e5d
commit
3beb3c8205
@ -76,7 +76,7 @@ impl Energy {
|
||||
/// So attempting to pass values that weren't returned from
|
||||
/// [`Self::needs_maximum_update`] can produce strange or unexpected
|
||||
/// results.
|
||||
pub fn update_maximum(&mut self, maximum: u32) {
|
||||
pub fn update_internal_integer_maximum(&mut self, maximum: u32) {
|
||||
self.maximum = maximum;
|
||||
// Clamp the current energy to enforce the current <= maximum invariant.
|
||||
self.current = self.current.min(self.maximum);
|
||||
|
@ -112,7 +112,7 @@ impl Health {
|
||||
/// So attempting to pass values that weren't returned from
|
||||
/// [`Self::needs_maximum_update`] can produce strange or unexpected
|
||||
/// results.
|
||||
pub fn update_maximum(&mut self, maximum: u32) {
|
||||
pub fn update_internal_integer_maximum(&mut self, maximum: u32) {
|
||||
self.maximum = maximum;
|
||||
// Clamp the current health to enforce the current <= maximum invariant.
|
||||
self.current = self.current.min(self.maximum);
|
||||
|
@ -93,7 +93,7 @@ impl<'a> System<'a> for Sys {
|
||||
let stat = stats;
|
||||
|
||||
if let Some(new_max) = health.needs_maximum_update(stat.max_health_modifiers) {
|
||||
health.update_maximum(new_max);
|
||||
health.update_internal_integer_maximum(new_max);
|
||||
}
|
||||
|
||||
// Calculates energy scaling from stats and inventory
|
||||
@ -104,7 +104,7 @@ impl<'a> System<'a> for Sys {
|
||||
};
|
||||
|
||||
if let Some(new_max) = energy.needs_maximum_update(energy_mods) {
|
||||
energy.update_maximum(new_max);
|
||||
energy.update_internal_integer_maximum(new_max);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user