Make projectiles not hit crit mobs unless clicked on (#27905)

This commit is contained in:
DrSmugleaf
2024-05-11 08:42:11 -07:00
committed by GitHub
parent 1698e1cfab
commit 8b88fe4bb7
7 changed files with 56 additions and 2 deletions

View File

@@ -278,6 +278,13 @@ public sealed partial class GunSystem : SharedGunSystem
private void ShootOrThrow(EntityUid uid, Vector2 mapDirection, Vector2 gunVelocity, GunComponent gun, EntityUid gunUid, EntityUid? user)
{
if (gun.Target is { } target && !TerminatingOrDeleted(target))
{
var targeted = EnsureComp<TargetedProjectileComponent>(uid);
targeted.Target = target;
Dirty(uid, targeted);
}
// Do a throw
if (!HasComp<ProjectileComponent>(uid))
{