Infantry attacks with secondary weapons #5528
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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