diff --git a/common/src/outcome.rs b/common/src/outcome.rs index 69ef8fb3da..1325ac75f8 100644 --- a/common/src/outcome.rs +++ b/common/src/outcome.rs @@ -1,4 +1,4 @@ -use crate::{combat::DamageContributor, comp, uid::Uid}; +use crate::{combat::DamageContributor, comp, uid::Uid, DamageSource}; use comp::{beam, item::Reagent, poise::PoiseState, skillset::SkillGroupKind, UtteranceKind}; use hashbrown::HashSet; use serde::{Deserialize, Serialize}; @@ -10,6 +10,7 @@ pub struct HealthChangeInfo { pub crit: bool, pub target: Uid, pub by: Option, + pub cause: Option, pub instance: u64, } diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index cdb9ec07e9..0b078e962e 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -81,6 +81,7 @@ pub fn handle_health_change(server: &Server, entity: EcsEntity, change: HealthCh amount: change.amount, by: change.by, target: *uid, + cause: change.cause, crit: change.crit, instance: change.instance, }, @@ -571,48 +572,47 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3) let stats = ecs.read_storage::(); let time = ecs.read_resource::