mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Energy now does not regen when climbing,gliding,and swimming
This commit is contained in:
parent
56c4b50a27
commit
c427f2298e
@ -1,5 +1,5 @@
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{ActionState, CharacterState, Energy, EnergySource, HealthSource, Stats},
|
comp::{ActionState, CharacterState, Energy, EnergySource, HealthSource, MovementState, Stats},
|
||||||
event::{EventBus, ServerEvent},
|
event::{EventBus, ServerEvent},
|
||||||
state::DeltaTime,
|
state::DeltaTime,
|
||||||
};
|
};
|
||||||
@ -97,6 +97,27 @@ impl<'a> System<'a> for Sys {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match character_state.movement {
|
||||||
|
MovementState::Climb => {
|
||||||
|
if energy.get_unchecked().regen_rate != 0.0 {
|
||||||
|
energy.get_mut_unchecked().regen_rate = 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
MovementState::Glide => {
|
||||||
|
if energy.get_unchecked().regen_rate != 0.0 {
|
||||||
|
energy.get_mut_unchecked().regen_rate = 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
MovementState::Swim => {
|
||||||
|
if energy.get_unchecked().regen_rate != 0.0 {
|
||||||
|
energy.get_mut_unchecked().regen_rate = 0.0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
_ => {
|
||||||
|
continue;
|
||||||
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user