mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
End roll when going too slow
This commit is contained in:
parent
22af8cb9d5
commit
5a41a58c0a
@ -57,7 +57,7 @@ impl<'a> System<'a> for Sys {
|
||||
|
||||
let animation = match (
|
||||
on_ground.is_some(),
|
||||
vel.0.magnitude() > 3.0, // Moving
|
||||
vel.0.magnitude_squared() > 10.0, // Moving
|
||||
attacking.is_some(),
|
||||
gliding.is_some(),
|
||||
rolling.is_some(),
|
||||
|
@ -108,7 +108,7 @@ impl<'a> System<'a> for Sys {
|
||||
&& attackings.get(entity).is_none()
|
||||
&& glidings.get(entity).is_none()
|
||||
&& on_ground.is_some()
|
||||
&& vel.0.magnitude() > 5.0
|
||||
&& vel.0.magnitude_squared() > 25.0
|
||||
{
|
||||
rollings.insert(entity, Rolling::start());
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ impl<'a> System<'a> for Sys {
|
||||
// Roll
|
||||
if let Some(time) = rollings.get_mut(entity).map(|r| &mut r.time) {
|
||||
*time += dt.0;
|
||||
if *time > 0.55 {
|
||||
if *time > 0.55 || vel.0.magnitude_squared() < 10.0 {
|
||||
rollings.remove(entity);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user