Skip to content

Commit

Permalink
black ice psr fix, test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Nov 3, 2024
1 parent b6387df commit 4bf1901
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7722,8 +7722,8 @@ public PilotingRollData checkSkid(EntityMovementType moveType, Hex prevHex,
boolean runOrSprint = (overallMoveType == EntityMovementType.MOVE_RUN) || (overallMoveType == EntityMovementType.MOVE_SPRINT);
boolean unitTouchesIce = (prevHex != null) && prevHex.containsTerrain(Terrains.ICE) && (currStep.getElevation() == 0);
boolean unitTouchesBlackIce = (prevHex != null) && prevHex.containsTerrain(Terrains.BLACK_ICE)
&& ((currStep.getElevation() == 0)
|| (prevHex.containsTerrain(Terrains.BRIDGE_ELEV) && currStep.getElevation() == prevHex.terrainLevel(Terrains.BRIDGE_ELEV)));
&& (((currStep.getElevation() == 0) && prevHex.containsAnyTerrainOf(Terrains.ROAD, Terrains.PAVEMENT))
|| (prevHex.containsTerrain(Terrains.BRIDGE_ELEV) && (currStep.getElevation() == prevHex.terrainLevel(Terrains.BRIDGE_ELEV))));
boolean isMoveAndTurn = (prevFacing != curFacing) && !Objects.equals(curPos, lastPos);

if (unitTouchesIce && affectedByIce && isMoveAndTurn) {
Expand Down
24 changes: 24 additions & 0 deletions megamek/testresources/data/scenarios/test_setups/BlackIceTest.mms
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
MMSVersion: 2
name: Black Ice Tests
planet: None
description: Units on a map with briges and roads in black ice conditions
map: testiceonwater.board

options:
on: black_ice

planetaryconditions:
temperature: -40
weather: ice storm

factions:
- name: Test Player

units:
- fullname: Locust LCT-1M
crew:
piloting: 0

- fullname: Locust LCT-1M
crew:
piloting: 0

0 comments on commit 4bf1901

Please sign in to comment.