Skip to content

Commit

Permalink
Only worry about gravity in specific conditions, to reduce extra proc…
Browse files Browse the repository at this point in the history
…essing
  • Loading branch information
Sleet01 committed Aug 7, 2024
1 parent 18b90db commit 8bab678
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion megamek/src/megamek/common/MovePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ public MovePath(final Game game, final Entity entity) {
this.setGame(game);
// Do we care about gravity when adding steps?
gravity = game.getPlanetaryConditions().getGravity();
gravityConcern = (gravity != 1.0F && game.getBoard().onGround() && !entity.isAirborne());
gravityConcern = (
(gravity > 1.0F && cachedEntityState.getJumpMPNoGravity() > 0
|| (gravity < 1.0F && cachedEntityState.getRunMP() > cachedEntityState.getRunMPNoGravity()))
&& game.getBoard().onGround() && !entity.isAirborne()
);
}

public Entity getEntity() {
Expand Down

0 comments on commit 8bab678

Please sign in to comment.