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

#5956: Ice-related skidding PSR checks (underwater movement etc) #6168

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Nov 2, 2024

Adds an elevation check so that units only skid on ice when at elevation 0 = on the ice, not under or above it.

Fixes #5956
Climb mode affects how a mek moves when in depth 2 water. In "thru" climb it'll stay at the bottom, otherwise (default) it'll try to climb and may fall back in

Copy link

codecov bot commented Nov 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.17%. Comparing base (336ba8f) to head (eccae84).
Report is 58 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6168      +/-   ##
============================================
- Coverage     29.19%   29.17%   -0.02%     
+ Complexity    13974    13972       -2     
============================================
  Files          2623     2628       +5     
  Lines        266435   266546     +111     
  Branches      47594    47572      -22     
============================================
- Hits          77775    77773       -2     
- Misses       184755   184889     +134     
+ Partials       3905     3884      -21     

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

@pavelbraginskiy
Copy link
Collaborator

Does this work if the hex is on a hill, so the surface of the ice isn't at level 0?

@SJuliez
Copy link
Member Author

SJuliez commented Nov 2, 2024

Elevation is relative to hex level, so ice can only be at elevation 0, meaning it should work which is not to say that it might not actually fail.

@pavelbraginskiy
Copy link
Collaborator

Hmm, there might still be an edge-case for bridges.

I'm not very familiar with how bridges or ice work in megamek, so maybe this isn't a possible scenario after all, but I believe under the rules you could conceivably have black ice on a bridge surface, with ice covering the water underneath the bridge, in which case you would have ice at two different elevations in one hex.

@SJuliez SJuliez marked this pull request as draft November 3, 2024 06:52
@SJuliez
Copy link
Member Author

SJuliez commented Nov 4, 2024

ok, updated the code to handle black ice on bridges. Should be good now

@SJuliez SJuliez marked this pull request as ready for review November 4, 2024 07:21
@SJuliez SJuliez merged commit 57ada27 into MegaMek:master Nov 5, 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.

[0.49.19.1] Movement with Water & Ice
2 participants