Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@SJuliez
Copy link
Member

@SJuliez SJuliez commented May 30, 2024

InfantryWeaponMounted was not a subclass of WeaponMounted but of Mounted instead. I assume this was done to keep the IWM class simple and not influenced by WeaponMounted stuff that it would never need. Unfortunately this meant that infantry with secondary weapons got no weapon attacks, as IWMs were not entered into a unit's weapon list (and could not without bigger changes - List). So, I made IWM a subclass of WeaponMounted and in nothing short of a miracle, it immediately compiled without any error and I could not find any errors when I set up a game where I shot at a target mek with two infantry units. We may of course find some error somewhere later because of this but I feel that mangling Entity's weaponList would not be the right way to go.

Fixes #5506

@HammerGS
Copy link
Member

Seems to be failing on the CodeQL

Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@SJuliez SJuliez merged commit f0ec421 into MegaMek:master Jun 2, 2024
@SJuliez SJuliez deleted the infantry-attacks-missing branch June 2, 2024 15:38
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.

[49.20] Issue : Some infantry squads are not being generated with their primary/secondary weapon as an attack option

3 participants