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

Campaign Option>Tech Limits>Use ammo by type (unofficial) does not seem to work #1665

Closed
plutonick opened this issue Apr 12, 2020 · 3 comments · Fixed by #1730
Closed

Campaign Option>Tech Limits>Use ammo by type (unofficial) does not seem to work #1665

plutonick opened this issue Apr 12, 2020 · 3 comments · Fixed by #1730
Labels

Comments

@plutonick
Copy link

Campaign Options > Tech Limits > Use ammo by type (unofficial), ie being able to load an LRM 5 with LRM20 ammo, is not working.

Environment

47.5 has been tested and it's not working. It's not working on 46.0 either

Description

image
image
image

@Windchild292
Copy link
Contributor

Test campaign from #1558.
Test30670103.cpnx.zip

This is the same as #1558, and I'm closing #1558 as this one has more information.

@ChaoticInsanity
Copy link
Contributor

ChaoticInsanity commented May 6, 2020

I am not sure the best way to fix this but it appears that the problem is AmmoType::equals only considers ammo equal if the type and rack size match. The methods leading to the check are correctly using the 'Use ammo by type' campaign option but the different rack sizes are never considered equal so the ammo from a different rack is not acceptable.

This failure happens when AmmoBin::getAmountAvailable calls Campaign::findSparePart where the predicate uses thisType.equals(((AmmoStorage)part).getType()).

Maybe a new special comparison method could be created and used in the predicate to compare the ammo type without the rack size.

@ChaoticInsanity
Copy link
Contributor

Updated test campaign the covers missile racks and autocannons.
Test_ACammo.cpnx.zip

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

Successfully merging a pull request may close this issue.

3 participants