}
if (TryComp<ProjectileComponent>(emitted, out var proj))
- _projectileSystem.SetShooter(proj, uid);
+ _projectileSystem.SetShooter(emitted, proj, uid);
if (TryComp<SinguloFoodComponent>(emitted, out var food))
{
using Content.Shared.Camera;
using Content.Shared.Damage;
using Content.Shared.Database;
-using Content.Shared.FixedPoint;
using Content.Shared.Projectiles;
using Robust.Server.GameObjects;
-using Robust.Shared.Player;
using Robust.Shared.Physics.Events;
+using Robust.Shared.Player;
namespace Content.Server.Projectiles;
RaiseLocalEvent(target, ref attemptEv);
if (attemptEv.Cancelled)
{
- SetShooter(component, target);
+ SetShooter(uid, component, target);
return;
}
var xform = Transform(uid);
var ent = Spawn(component.BoltType, xform.Coordinates);
var proj = EnsureComp<ProjectileComponent>(ent);
- _projectile.SetShooter(proj, uid);
+ _projectile.SetShooter(ent, proj, uid);
var targetPos = new EntityCoordinates(uid, new Vector2(0, -1));
using Content.Shared.Damage.Systems;
using Content.Shared.Database;
using Content.Shared.Effects;
-using Content.Shared.FixedPoint;
using Content.Shared.Interaction.Components;
using Content.Shared.Projectiles;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Ranged;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Weapons.Ranged.Events;
+using Content.Shared.Weapons.Ranged.Systems;
using Content.Shared.Weapons.Reflect;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
-using SharedGunSystem = Content.Shared.Weapons.Ranged.Systems.SharedGunSystem;
namespace Content.Server.Weapons.Ranged.Systems;
if (user != null)
{
var projectile = EnsureComp<ProjectileComponent>(uid);
- Projectiles.SetShooter(projectile, user.Value);
+ Projectiles.SetShooter(uid, projectile, user.Value);
projectile.Weapon = gunUid;
}
using Content.Shared.DoAfter;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
-using Content.Shared.Projectiles;
-using Content.Shared.Sound.Components;
using Content.Shared.Throwing;
-using Content.Shared.Weapons.Ranged.Components;
-using Robust.Shared.Audio;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Physics;
}
}
- public void SetShooter(ProjectileComponent component, EntityUid uid)
+ public void SetShooter(EntityUid id, ProjectileComponent component, EntityUid shooterId)
{
- if (component.Shooter == uid)
+ if (component.Shooter == shooterId)
return;
- component.Shooter = uid;
- Dirty(uid, component);
+ component.Shooter = shooterId;
+ Dirty(id, component);
}
[Serializable, NetSerializable]