From 242a0d35bd7a21ca57325b1aade0daa4ec78a6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Sat, 26 Oct 2019 17:36:43 +0200 Subject: [PATCH] fixing character movement to no longer fail normalization then get a zero vec and then normalize again may this can be further simplyfied --- common/src/sys/movement.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/common/src/sys/movement.rs b/common/src/sys/movement.rs index d530a89e82..638d9e715c 100644 --- a/common/src/sys/movement.rs +++ b/common/src/sys/movement.rs @@ -102,12 +102,9 @@ impl<'a> System<'a> for Sys { if character.movement.is_roll() { vel.0 = Vec3::new(0.0, 0.0, vel.0.z) + (vel.0 * Vec3::new(1.0, 1.0, 0.0) - + 1.5 - * inputs - .move_dir - .try_normalized() - .unwrap_or(Vec2::from(vel.0).try_normalized().unwrap_or_default())) - .normalized() + + 1.5 * inputs.move_dir.try_normalized().unwrap_or_default()) + .try_normalized() + .unwrap_or_default() * ROLL_SPEED; } if character.action.is_block() || character.action.is_attack() {