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

'detonate on expiration' weapon flag #5528

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

Goober5000
Copy link
Contributor

For mods which want primary weapons to 'detonate', setting the detonation range is not reliable because, due to rounding imprecision, either the range (which detonates) or the lifetime (which does not) may happen first. So this adds a flag to always detonate a weapon when its lifetime expires. Secondary weapons have this flag by default, but primary weapons can add this flag in the $Flags list. Additionally, if the detonation range and the predicted range due to lifetime are equal, the flag is added automatically.

Resolves #5521.

For mods which want primary weapons to 'detonate', setting the detonation range is not reliable because, due to rounding imprecision, either the range (which detonates) or the lifetime (which does not) may happen first.  So this adds a flag to always detonate a weapon when its lifetime expires.  Secondary weapons have this flag by default, but primary weapons can add this flag in the $Flags list.  Additionally, if the detonation range and the predicted range due to lifetime are equal, the flag is added automatically.

Resolves scp-fs2open#5521.
@Goober5000 Goober5000 added enhancement A new feature or upgrade of an existing feature to add additional functionality. fix A fix for bugs, not-a-bugs, and/or regressions. labels Jul 29, 2023
@Goober5000 Goober5000 added this to the Release 23.2 milestone Jul 29, 2023
code/weapon/weapons.cpp Outdated Show resolved Hide resolved
@Goober5000 Goober5000 merged commit e285641 into scp-fs2open:master Aug 8, 2023
14 checks passed
@Goober5000 Goober5000 deleted the detonate_on_expiration branch August 8, 2023 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or upgrade of an existing feature to add additional functionality. fix A fix for bugs, not-a-bugs, and/or regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detonate-on-death flag for weapons
3 participants