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

Fix machine gun array burst damage against conventional infantry #4841

Closed
wants to merge 6 commits into from

Conversation

neoancient
Copy link
Member

Against most units a machine gun array rolls on the cluster hits table to determine the number of weapons that hit. Against conventional infantry the number of burst damage dice is supposed to be multiplied by the number of linked weapons.

I've also modified the report to show the amount of damage done by any burst weapon.
1D6/2 is not an issue because it is only used by BA weapons, and cannot be part of a MGA.

Fixes #4745.

@neoancient neoancient closed this Oct 18, 2023
@neoancient neoancient deleted the mga_infantry_burst branch October 18, 2023 15:41
damage = applyGlancingBlowModifier(damage, true);
if (game.getOptions().booleanOption(OptionsConstants.ADVCOMBAT_TACOPS_RANGE)) {
if (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG]) {
damage *= 0.75;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type double to narrower destination type int.
if (nRange > wtype.getRanges(weapon)[RangeType.RANGE_LONG]) {
damage *= 0.75;
} else if (nRange > wtype.getRanges(weapon)[RangeType.RANGE_EXTREME]) {
damage *= 0.5;

Check failure

Code scanning / CodeQL

Implicit narrowing conversion in compound assignment High

Implicit cast of source type double to narrower destination type int.
@neoancient
Copy link
Member Author

Closed because of cruft in the branch.

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.

Machine gun arrays do not operate correctly against conventional infantry
1 participant