Fix gun dump bug (#15936)
This commit is contained in:
@@ -223,13 +223,15 @@ public abstract partial class SharedGunSystem : EntitySystem
|
|||||||
if (gun.NextFire > curTime)
|
if (gun.NextFire > curTime)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var fireRate = TimeSpan.FromSeconds(1f / gun.FireRate);
|
||||||
|
|
||||||
// First shot
|
// First shot
|
||||||
if (gun.ShotCounter == 0 && gun.NextFire < curTime)
|
// Previously we checked shotcounter but in some cases all the bullets got dumped at once
|
||||||
|
if (gun.NextFire < curTime - fireRate)
|
||||||
gun.NextFire = curTime;
|
gun.NextFire = curTime;
|
||||||
|
|
||||||
var shots = 0;
|
var shots = 0;
|
||||||
var lastFire = gun.NextFire;
|
var lastFire = gun.NextFire;
|
||||||
var fireRate = TimeSpan.FromSeconds(1f / gun.FireRate);
|
|
||||||
|
|
||||||
while (gun.NextFire <= curTime)
|
while (gun.NextFire <= curTime)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user