Fix run direction not being taken into account when accelerating (Fixes #11)
CI / build-and-test (pull_request) Successful in 11m3s

This commit is contained in:
2026-09-16 20:31:25 +02:00
parent ae8f7b5850
commit 31e41f3800
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -150,6 +150,7 @@ pub struct UpdateContext<'a> {
pub fighter_attributes: &'a FighterAttributes, pub fighter_attributes: &'a FighterAttributes,
pub attack_scripts: &'a Assets<FighterAttackScript>, pub attack_scripts: &'a Assets<FighterAttackScript>,
pub attack_script_assets: &'a FighterAttackScriptAssets, pub attack_script_assets: &'a FighterAttackScriptAssets,
pub facing_direction: &'a FighterFacingDirection,
} }
impl UpdateContext<'_> { impl UpdateContext<'_> {
@@ -290,6 +291,7 @@ impl<'w, 's> FighterFrameQueryItem<'w, 's> {
fighter_attributes: attributes, fighter_attributes: attributes,
attack_scripts, attack_scripts,
attack_script_assets, attack_script_assets,
facing_direction: &self.facing_direction
} }
} }
+1 -1
View File
@@ -41,7 +41,7 @@ impl FighterStateImpl for RunState {
let last_frame = state_context.input.get_last_frame(); let last_frame = state_context.input.get_last_frame();
let (accel, target_vel) = state_context let (accel, target_vel) = state_context
.fighter_attributes .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( let accel = ground::compute_ground_accel(
accel, accel,
target_vel, target_vel,