Fix NT-3 (#4764)
This commit is contained in:
parent
03eccfbeee
commit
4a0736235b
|
|
@ -404,7 +404,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||
var shooterEv = new ShooterImpulseEvent();
|
||||
RaiseLocalEvent(user, ref shooterEv);
|
||||
|
||||
if (shooterEv.Push)
|
||||
if (shooterEv.Push && !shooterEv.CannotBePushed) // DeltaV - Bipods stop you from being moved by recoil.
|
||||
CauseImpulse(fromCoordinates, toCoordinates.Value, user, userPhysics);
|
||||
}
|
||||
|
||||
|
|
@ -662,6 +662,7 @@ public record struct GunShotEvent(EntityUid User, List<(EntityUid? Uid, IShootab
|
|||
public record struct ShooterImpulseEvent()
|
||||
{
|
||||
public bool Push;
|
||||
public bool CannotBePushed; // DeltaV - Bipods stop you from being moved by recoil.
|
||||
};
|
||||
|
||||
public enum EffectLayers : byte
|
||||
|
|
|
|||
|
|
@ -26,8 +26,10 @@ public abstract partial class SharedGunSystem
|
|||
|
||||
SubscribeLocalEvent<GunBipodComponent, GunRefreshModifiersEvent>(OnGunRefreshModifiers);
|
||||
SubscribeLocalEvent<GunBipodComponent, BipodSetupFinishedEvent>(SetupBipod);
|
||||
SubscribeLocalEvent<GunBipodComponent, ShotAttemptedEvent>(OnShotAttempted);
|
||||
SubscribeLocalEvent<IsUsingBipodComponent, MoveEvent>(OnMove);
|
||||
|
||||
SubscribeLocalEvent<GunBipodComponent, ShotAttemptedEvent>(OnShotAttempted);
|
||||
SubscribeLocalEvent<IsUsingBipodComponent, ShooterImpulseEvent>(OnImpulse);
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<GunBipodComponent> weapon, ref MapInitEvent args)
|
||||
|
|
@ -188,9 +190,14 @@ public abstract partial class SharedGunSystem
|
|||
private void OnShotAttempted(Entity<GunBipodComponent> ent, ref ShotAttemptedEvent args)
|
||||
{
|
||||
// This is true when the bipod is being set up - Preventing the gun from shooting.
|
||||
if (Timing.CurTime < ent.Comp.BipodSetupTime + ent.Comp.SetupDelay)
|
||||
if (Timing.CurTime < ent.Comp.BipodSetupTime + ent.Comp.SetupDelay + TimeSpan.FromSeconds(0.1))
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnImpulse(Entity<IsUsingBipodComponent> bipodUser, ref ShooterImpulseEvent args)
|
||||
{
|
||||
args.CannotBePushed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Reference in New Issue