-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for BurstDelays 0 #15761
Support for BurstDelays 0 #15761
Conversation
8cf3d70
to
d16025b
Compare
@@ -186,6 +186,7 @@ public override void DoAttack(Actor self, Target target, IEnumerable<Armament> a | |||
} | |||
|
|||
foreach (var npa in self.TraitsImplementing<INotifyAttack>()) | |||
foreach (var barrel in barrels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing one level of indentation.
d16025b
to
28b67be
Compare
updated |
Why close this? |
I had a rare occurence causing the game to freeze in an infinite loop. Didnt manage to find it. Ill reinvestigate this in a few weeks and redo the PR. |
|
||
if (ticksSinceLastShot >= Weapon.ReloadDelay) | ||
Burst = Weapon.Burst; | ||
while (CanFire(self, target)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will loop infinitely if the weapon has BurstDelays: 0
, doesn't use an ammopool to pause the trait, and is in range and valid against the target.
Support for weapons which fire a whole clip / burst at once, without a delay between the shots. This avoids the need for ugly hacks, giving actors for example 10 armaments if they have to shoot 10 shots at once.