fix contact damage and test with impaler

This commit is contained in:
Jim 2025-08-26 08:26:59 -04:00
parent 9d397451c4
commit e9790f156d
Signed by: jim
GPG key ID: 3236D2F059A7C0AC
6 changed files with 16 additions and 13 deletions

View file

@ -19,6 +19,7 @@ impl Plugin for CombatDamagersPlugin {
}
#[derive(Component)]
#[require(CollisionEventsEnabled)]
pub struct ContactDamage {
pub amount: f32,
}
@ -29,6 +30,7 @@ fn deal_contact_damage(
mut commands: Commands,
) {
for event in reader.read() {
info!("event recv!");
if let Ok(contact) = query.get(event.0) {
commands.trigger_targets(
Attacked {