diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index c293f12aa7..c182d53f44 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -237,10 +237,12 @@ namespace Content.Server.Zombies private void OnMeleeHit(EntityUid uid, ZombieComponent component, MeleeHitEvent args) { - // this prevents a player using a zombie mouse as a weapon to infect people if (!TryComp(args.User, out _)) return; + if (!args.HitEntities.Any()) + return; + foreach (var entity in args.HitEntities) { if (args.User == entity) @@ -249,14 +251,20 @@ namespace Content.Server.Zombies if (!TryComp(entity, out var mobState)) continue; - var canZombify = !HasComp(entity) && !HasComp(entity); - if (canZombify && !HasComp(args.User) && _random.Prob(GetZombieInfectionChance(entity, component))) + if (HasComp(entity)) { - EnsureComp(entity); - EnsureComp(entity); + args.BonusDamage = -args.BaseDamage; + } + else + { + if (!HasComp(entity) && !HasComp(args.User) && _random.Prob(GetZombieInfectionChance(entity, component))) + { + EnsureComp(entity); + EnsureComp(entity); + } } - if (_mobState.IsIncapacitated(entity, mobState) && canZombify) + if (_mobState.IsIncapacitated(entity, mobState) && !HasComp(entity) && !HasComp(entity) && !HasComp(args.User)) { ZombifyEntity(entity); args.BonusDamage = -args.BaseDamage;