Fix various minor issues (#74)
CI / production-build (push) Canceled after 0s
CI / build-and-test (push) Canceled after 29s

Reviewed-on: #74
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #74.
This commit is contained in:
2026-09-28 15:08:39 +00:00
committed by EIREXE
parent e02dff58e5
commit ccf2657d29
10 changed files with 36 additions and 16 deletions
+2 -1
View File
@@ -115,8 +115,9 @@ pub fn update_standard_motion(
pub fn collision_interrupt(
ctx: &mut CollisionContext,
landing_type: LandingType,
can_ignore_soft_platforms: bool,
) -> Option<FighterState> {
let res = ctx.air_collide_with_stage()?;
let res = ctx.air_collide_with_stage(can_ignore_soft_platforms)?;
let diff = res.hit_position - ctx.translation.0;
ctx.ecb.bottom -= diff;
ctx.ecb.top -= diff;
+1 -1
View File
@@ -45,7 +45,7 @@ impl FighterStateImpl for AirDodgeState {
&mut self,
state_context: &mut CollisionContext,
) -> Option<FighterState> {
air::collision_interrupt(state_context, LandingType::Special)
air::collision_interrupt(state_context, LandingType::Special, false)
}
fn on_enter(&mut self, state_context: &mut EnterContext) {
+1
View File
@@ -38,6 +38,7 @@ impl FighterStateImpl for FallState {
air::collision_interrupt(
state_context,
crate::fighter::state::land::LandingType::Normal,
true,
)
}
+3 -3
View File
@@ -11,8 +11,7 @@ use crate::{
land::LandingType,
wait::WaitState,
},
},
math::int::FGi32,
}, math::{int::FGi32, vec::FGVec2},
};
#[derive(Clone, Debug, Hash)]
@@ -103,6 +102,7 @@ impl FighterStateImpl for HitstunState {
HitstopStateKind::Airborne => AnimKind::FlinchAir,
};
state_context.play_animation(animation, false);
state_context.velocity.0 = FGVec2::ZERO;
}
fn on_exit(&mut self, _state_context: &mut ExitContext) {}
@@ -114,7 +114,7 @@ impl FighterStateImpl for HitstunState {
match &mut self.hitstop_kind {
HitstopStateKind::Grounded => collision_interrupt(state_context, true),
HitstopStateKind::Airborne => {
air::collision_interrupt(state_context, LandingType::Normal)
air::collision_interrupt(state_context, LandingType::Normal, false)
}
}
}
+1
View File
@@ -180,6 +180,7 @@ impl FighterStateImpl for JumpState {
air::collision_interrupt(
state_context,
crate::fighter::state::land::LandingType::Normal,
true,
)
}
+3 -2
View File
@@ -214,10 +214,11 @@ pub struct CollisionContext<'a> {
impl CollisionContext<'_> {
pub fn air_collide_with_stage(
&self,
can_ignore_soft_platforms: bool,
) -> Option<crate::fighter::collision::AirCollisionWithStageResult> {
let ignored_polys = self.surface.ignored_polygon_ids();
let ignore_soft_platforms =
self.input.get_last_frame().movement.y <= -self.downward_stick_threshold;
let ignore_soft_platforms = can_ignore_soft_platforms
&& self.input.get_last_frame().movement.y <= -self.downward_stick_threshold;
crate::fighter::collision::air_collide_with_stage(
self.prev_translation,
self.translation,
+1
View File
@@ -46,6 +46,7 @@ impl FighterStateImpl for PlatformPassState {
air::collision_interrupt(
state_context,
crate::fighter::state::land::LandingType::Normal,
true,
)
}
+2 -2
View File
@@ -3,7 +3,7 @@ use super::{
ground, wait,
};
use crate::fighter::animation::AnimKind;
use crate::fighter::state::FighterState;
use crate::fighter::state::{self, FighterState};
#[derive(Debug, Clone, Hash)]
pub struct WalkState;
@@ -14,7 +14,7 @@ impl FighterStateImpl for WalkState {
if let Some(state) = ground::grounded_movement_common_interrupts(state_context) {
return Some(state);
}
wait::check_input(state_context).or_else(|| dash::check_input(state_context))
wait::check_input(state_context).or_else(|| dash::check_input(state_context)).or_else(|| state::ground_attack::check_interrupt(state_context))
}
fn on_enter(&mut self, state_context: &mut EnterContext) {