Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Conversation

IceReaper
Copy link
Contributor

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.

@IceReaper IceReaper force-pushed the burstdelay0 branch 2 times, most recently from 8cf3d70 to d16025b Compare October 31, 2018 13:57
@@ -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)
Copy link
Member

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.

@IceReaper
Copy link
Contributor Author

updated

@IceReaper IceReaper closed this Nov 11, 2018
@IceReaper IceReaper deleted the burstdelay0 branch November 11, 2018 23:55
@pchote
Copy link
Member

pchote commented Nov 11, 2018

Why close this?

@IceReaper
Copy link
Contributor Author

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))
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants