Skip to content

Commit

Permalink
check elevation for ice-related PSR checks (underwater movement etc)
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Nov 2, 2024
1 parent f19b659 commit f0774d0
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -7762,21 +7762,22 @@ public PilotingRollData checkSkid(EntityMovementType moveType, Hex prevHex,
boolean runOrSprint = (overallMoveType == EntityMovementType.MOVE_RUN)
|| (overallMoveType == EntityMovementType.MOVE_SPRINT);
if ((prevHex != null)
&& prevHex.containsTerrain(Terrains.ICE)
&& iceCheck
&& (prevFacing != curFacing)
&& !lastPos.equals(curPos)) {
&& prevHex.containsTerrain(Terrains.ICE)
&& (currStep.getElevation() == 0)
&& iceCheck
&& (prevFacing != curFacing)
&& !lastPos.equals(curPos)) {
roll.append(new PilotingRollData(getId(), getMovementBeforeSkidPSRModifier(distance), "turning on ice"));
adjustDifficultTerrainPSRModifier(roll);
return roll;
} else if ((prevHex != null)
&& prevHex.containsTerrain(Terrains.BLACK_ICE)
&& iceCheck
&& (prevFacing != curFacing)
&& !lastPos.equals(curPos)) {
&& prevHex.containsTerrain(Terrains.BLACK_ICE)
&& (currStep.getElevation() == 0)
&& iceCheck
&& (prevFacing != curFacing)
&& !lastPos.equals(curPos)) {
addPilotingModifierForTerrain(roll, lastPos);
roll.append(
new PilotingRollData(getId(), getMovementBeforeSkidPSRModifier(distance), "turning on black ice"));
roll.append(new PilotingRollData(getId(), getMovementBeforeSkidPSRModifier(distance), "turning on black ice"));
adjustDifficultTerrainPSRModifier(roll);
return roll;
} else if (prevStepPavement
Expand Down

0 comments on commit f0774d0

Please sign in to comment.