mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Update common/src/sys/movement.rs
This commit is contained in:
parent
a49482503d
commit
0cd8150e98
@ -232,18 +232,18 @@ impl<'a> System<'a> for Sys {
|
||||
character.movement == Climb && vel.0.z <= CLIMB_SPEED,
|
||||
physics.on_wall,
|
||||
) {
|
||||
if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() {
|
||||
if energy
|
||||
if inputs.climb_down.is_pressed() && !inputs.climb.is_pressed() && energy
|
||||
.get_mut_unchecked()
|
||||
.try_change_by(-CLIMB_COST, EnergySource::Climb)
|
||||
.is_ok(){
|
||||
.is_ok()
|
||||
{
|
||||
vel.0 -= dt.0 * vel.0.map(|e| e.abs().powf(1.5) * e.signum() * 6.0);
|
||||
}
|
||||
} else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() {
|
||||
if energy
|
||||
} else if inputs.climb.is_pressed() && !inputs.climb_down.is_pressed() && energy
|
||||
.get_mut_unchecked()
|
||||
.try_change_by(-CLIMB_COST, EnergySource::Climb)
|
||||
.is_ok(){
|
||||
.is_ok()
|
||||
{
|
||||
vel.0.z = (vel.0.z + dt.0 * GRAVITY * 1.25).min(CLIMB_SPEED).max(0.0);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user