diff --git a/Barotrauma/BarotraumaShared/Source/Characters/Attack.cs b/Barotrauma/BarotraumaShared/Source/Characters/Attack.cs index bc498df98..841d965d8 100644 --- a/Barotrauma/BarotraumaShared/Source/Characters/Attack.cs +++ b/Barotrauma/BarotraumaShared/Source/Characters/Attack.cs @@ -161,16 +161,20 @@ namespace Barotrauma public AttackResult DoDamage(Character attacker, IDamageable target, Vector2 worldPosition, float deltaTime, bool playSound = true) { + Character targetCharacter = target as Character; if (OnlyHumans) { - Character character = target as Character; - if (character != null && character.ConfigPath != Character.HumanConfigFile) return new AttackResult(); + if (targetCharacter != null && targetCharacter.ConfigPath != Character.HumanConfigFile) return new AttackResult(); } DamageParticles(deltaTime, worldPosition); - + var attackResult = target.AddDamage(attacker, worldPosition, this, deltaTime, playSound); var effectType = attackResult.Damage > 0.0f ? ActionType.OnUse : ActionType.OnFailure; + if (targetCharacter != null && targetCharacter.IsDead) + { + effectType = ActionType.OnEating; + } if (statusEffects == null) return attackResult; foreach (StatusEffect effect in statusEffects) diff --git a/Barotrauma/BarotraumaShared/Source/Items/Item.cs b/Barotrauma/BarotraumaShared/Source/Items/Item.cs index 54ef20b8d..2bc3bf6a6 100644 --- a/Barotrauma/BarotraumaShared/Source/Items/Item.cs +++ b/Barotrauma/BarotraumaShared/Source/Items/Item.cs @@ -20,7 +20,8 @@ namespace Barotrauma OnWearing, OnContaining, OnContained, OnActive, OnFailure, OnBroken, OnFire, InWater, - OnImpact + OnImpact, + OnEating } partial class Item : MapEntity, IDamageable, ISerializableEntity, IServerSerializable, IClientSerializable