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

Skip to content

Conversation

@Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented May 12, 2025

What it does?

Fixes the way elevation is set for units with MovementMode WiGE and HOVER during jumping, and fixes an OOB exception on collapsing bridges.

In a unit test I managed to reproduce the bug where hovers take flight after jumping over a building.

Related issues:

@Scoppio Scoppio self-assigned this May 12, 2025
@Scoppio Scoppio added the Bug Any kind of issue that cannot be fixed without code changes label May 12, 2025
@codecov
Copy link

codecov bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 30.40%. Comparing base (9027d65) to head (40d3098).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
...src/megamek/server/totalwarfare/TWGameManager.java 0.00% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #7031      +/-   ##
============================================
+ Coverage     30.22%   30.40%   +0.18%     
- Complexity    15889    16167     +278     
============================================
  Files          2895     2895              
  Lines        284655   284659       +4     
  Branches      49529    49531       +2     
============================================
+ Hits          86036    86558     +522     
+ Misses       192992   192129     -863     
- Partials       5627     5972     +345     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sleet01
Copy link
Collaborator

Sleet01 commented May 12, 2025

Nice!

@Scoppio Scoppio marked this pull request as ready for review May 13, 2025 01:51
Copilot AI review requested due to automatic review settings May 13, 2025 01:51
@Scoppio Scoppio requested a review from a team as a code owner May 13, 2025 01:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes jumping elevation issues for units in WiGE and HOVER modes and addresses an out-of-bounds exception in bridge collapse handling. Key changes include:

  • Adding and updating several unit tests in JumpTest.java and MovePathTest.java to validate jump behavior.
  • Adjusting elevation calculations in MoveStep.java to correctly handle WiGE and HOVER movement modes.
  • Updating comments and safeguards in TWGameManager.java to prevent OOB exceptions and ensuring clarity in load handling across floors.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
megamek/unittests/megamek/common/movepath/JumpTest.java Added comprehensive tests for jump paths across multiple terrains.
megamek/unittests/megamek/common/MovePathTest.java Minor import reordering to follow test conventions.
megamek/src/megamek/server/totalwarfare/TWGameManager.java Updated comments related to collapse load safeguards and added import.
megamek/src/megamek/common/MoveStep.java Modified elevation logic using a switch statement for movement modes.

@Scoppio Scoppio force-pushed the fix/flying-jumping-hovers branch from 5a65786 to 9dd1e6c Compare May 13, 2025 01:54
@Scoppio Scoppio force-pushed the fix/flying-jumping-hovers branch from 9dd1e6c to acd5f76 Compare May 13, 2025 01:55
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.

Looks good to me; I'm loving the new tests!

@Scoppio Scoppio merged commit e9adcd3 into MegaMek:master May 13, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Any kind of issue that cannot be fixed without code changes

Projects

None yet

2 participants