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

Issue 6271: Offboard units to the North and West will be placed properly #6308

Merged

Conversation

psikomonkie
Copy link
Collaborator

Fixes #6271

Offboard units to the North and West will be placed properly; use one method for determining artillery travel time

Units placed to the South and East will be placed at coordinates (0 indexed!) map-dimension (1-indexed!) + offboard distance.

Units placed to the North and West were placed at coordinates (0 indexed!) -offboard distance.

This resulted in units to the North and West being one hex closer than they should be, allowing users to fire artillery at less than a mapsheet despite being offboard, which shouldn't be possible. This was already accounted for with the South and East because they use the 1-indexed map dimension.

I also noticed an identical artillery flight time algorithm in Entity.java and ArtilleryAttackAction.java. The one in Entity was already a method, so I changed ArtilleryAttackAction.java to use that method rather than implementing it on its own.

…rly; use one method for determining artillery travel time
Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.95%. Comparing base (3b7ac02) to head (837ceda).
Report is 17 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6308      +/-   ##
============================================
- Coverage     28.95%   28.95%   -0.01%     
+ Complexity    14032    14031       -1     
============================================
  Files          2672     2672              
  Lines        269292   269296       +4     
  Branches      47929    47934       +5     
============================================
- Hits          77970    77969       -1     
- Misses       187418   187426       +8     
+ Partials       3904     3901       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HoneySkull HoneySkull merged commit 6480c6d into MegaMek:master Dec 25, 2024
6 checks passed
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.

12/13 Logistics artifact - 0.50.02 - Offboard artillery at 17 maps landing on round it is fired
3 participants