fix ninja no guns (#20184)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -12,6 +12,11 @@ public record struct ShotAttemptedEvent
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public EntityUid User;
|
public EntityUid User;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The gun being shot.
|
||||||
|
/// </summary>
|
||||||
|
public EntityUid Used;
|
||||||
|
|
||||||
public bool Cancelled { get; private set; }
|
public bool Cancelled { get; private set; }
|
||||||
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -226,12 +226,17 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||||||
// check if anything wants to prevent shooting
|
// check if anything wants to prevent shooting
|
||||||
var prevention = new ShotAttemptedEvent
|
var prevention = new ShotAttemptedEvent
|
||||||
{
|
{
|
||||||
User = user
|
User = user,
|
||||||
|
Used = gunUid
|
||||||
};
|
};
|
||||||
RaiseLocalEvent(gunUid, ref prevention);
|
RaiseLocalEvent(gunUid, ref prevention);
|
||||||
if (prevention.Cancelled)
|
if (prevention.Cancelled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
RaiseLocalEvent(user, ref prevention);
|
||||||
|
if (prevention.Cancelled)
|
||||||
|
return;
|
||||||
|
|
||||||
// Need to do this to play the clicking sound for empty automatic weapons
|
// Need to do this to play the clicking sound for empty automatic weapons
|
||||||
// but not play anything for burst fire.
|
// but not play anything for burst fire.
|
||||||
if (gun.NextFire > curTime)
|
if (gun.NextFire > curTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user