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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

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);
}