Make combat reaction state rollback-safe (#34)
CI / build-and-test (push) Successful in 13m10s

## Summary

- replace the per-fighter received-attack inbox with a typed rollback-registered pending-hit resource
- split combat reaction resolution into its own attack module
- remap entity references during rollback and include pending hits in debug save states

Fixes #21

Reviewed-on: #34
Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #34.
This commit is contained in:
2026-09-16 17:50:40 +00:00
committed by EIREXE
parent 352c6fcb6c
commit 43ee6d8153
4 changed files with 195 additions and 163 deletions
+2 -5
View File
@@ -37,8 +37,8 @@ use crate::{
fighter::{
attack::{
AttackKind, FighterAttackPlugin, FighterAttackScriptAssets, FighterDamage,
FighterKnockbackVelocity, FighterPendingHitReaction, FighterReceivedAttacks,
FighterSolvedHurtboxes, FighterStaleMoveQueue,
FighterKnockbackVelocity, FighterPendingHitReaction, FighterSolvedHurtboxes,
FighterStaleMoveQueue,
},
baked_animation::{FighterBoneIndexMap, FighterBoneMatrices},
manifest::FighterManifest,
@@ -116,7 +116,6 @@ pub struct FighterVisual;
#[derive(Component)]
#[require(
FighterReceivedAttacks,
FighterStaleMoveQueue,
FighterDamage,
FighterPendingHitReaction,
@@ -199,8 +198,6 @@ impl Plugin for FighterPlugin {
.checksum_component_with_hash::<FighterHitstop>()
.rollback_component_with_copy::<FighterKnockbackVelocity>()
.checksum_component_with_hash::<FighterKnockbackVelocity>()
.rollback_component_with_clone::<FighterReceivedAttacks>()
.checksum_component_with_hash::<FighterReceivedAttacks>()
.rollback_resource_with_reflect::<StageCollision>()
// Debug views.
.add_systems(