From 31e41f38008ac50463b277fd7444bc2723d744be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lex=20Rom=C3=A1n=20N=C3=BA=C3=B1ez?= Date: Wed, 16 Sep 2026 19:55:18 +0200 Subject: [PATCH] Fix run direction not being taken into account when accelerating (Fixes #11) --- src/fighter/state/mod.rs | 2 ++ src/fighter/state/run.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fighter/state/mod.rs b/src/fighter/state/mod.rs index 65adbfa..c026097 100644 --- a/src/fighter/state/mod.rs +++ b/src/fighter/state/mod.rs @@ -150,6 +150,7 @@ pub struct UpdateContext<'a> { pub fighter_attributes: &'a FighterAttributes, pub attack_scripts: &'a Assets, pub attack_script_assets: &'a FighterAttackScriptAssets, + pub facing_direction: &'a FighterFacingDirection, } impl UpdateContext<'_> { @@ -290,6 +291,7 @@ impl<'w, 's> FighterFrameQueryItem<'w, 's> { fighter_attributes: attributes, attack_scripts, attack_script_assets, + facing_direction: &self.facing_direction } } diff --git a/src/fighter/state/run.rs b/src/fighter/state/run.rs index 0147592..afb40d6 100644 --- a/src/fighter/state/run.rs +++ b/src/fighter/state/run.rs @@ -41,7 +41,7 @@ impl FighterStateImpl for RunState { let last_frame = state_context.input.get_last_frame(); let (accel, target_vel) = state_context .fighter_attributes - .get_accel_and_target_dashrun(&last_frame, FGi32::ONE); + .get_accel_and_target_dashrun(&last_frame, state_context.facing_direction.to_sign()); let accel = ground::compute_ground_accel( accel, target_vel, -- 2.54.0