Bunch of revolver fixes (#19649)

* Bunch of revolver fixes

Some stuff wasn't working with prediction so this should fix all of it.

* a

* fix weh

* Also usedelay
This commit is contained in:
metalgearsloth
2024-01-21 22:16:46 +11:00
committed by GitHub
parent 15f91b0720
commit 9bb2781bfc
5 changed files with 95 additions and 46 deletions

View File

@@ -15,6 +15,7 @@ using Content.Shared.Popups;
using Content.Shared.Projectiles;
using Content.Shared.Tag;
using Content.Shared.Throwing;
using Content.Shared.Timing;
using Content.Shared.Verbs;
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
@@ -61,6 +62,7 @@ public abstract partial class SharedGunSystem : EntitySystem
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
[Dependency] protected readonly TagSystem TagSystem = default!;
[Dependency] protected readonly ThrowingSystem ThrowingSystem = default!;
[Dependency] private readonly UseDelaySystem _useDelay = default!;
private const float InteractNextFire = 0.3f;
private const double SafetyNextFire = 0.5;
@@ -408,7 +410,7 @@ public abstract partial class SharedGunSystem : EntitySystem
/// <summary>
/// Call this whenever the ammo count for a gun changes.
/// </summary>
protected virtual void UpdateAmmoCount(EntityUid uid) {}
protected virtual void UpdateAmmoCount(EntityUid uid, bool prediction = true) {}
protected void SetCartridgeSpent(EntityUid uid, CartridgeAmmoComponent cartridge, bool spent)
{