Stop toys from electrocuting on attack (#15318)

This commit is contained in:
Dawid Bla
2023-04-12 02:11:55 +02:00
committed by GitHub
parent f474171451
commit c6de63c535

View File

@@ -130,6 +130,13 @@ namespace Content.Server.Electrocution
if (!electrified.OnAttacked)
return;
//Dont shock if the attacker used a toy
if (EntityManager.TryGetComponent<MeleeWeaponComponent>(args.Used, out var meleeWeaponComponent))
{
if (meleeWeaponComponent.Damage.Total == 0)
return;
}
TryDoElectrifiedAct(uid, args.User, 1, electrified);
}