From 8bab678c8c3df7599ea63a34a8b1e28a772a58a7 Mon Sep 17 00:00:00 2001 From: sleet01 Date: Wed, 7 Aug 2024 10:57:51 -0700 Subject: [PATCH] Only worry about gravity in specific conditions, to reduce extra processing --- megamek/src/megamek/common/MovePath.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/MovePath.java b/megamek/src/megamek/common/MovePath.java index 6192f62d4f4..26c71784f37 100644 --- a/megamek/src/megamek/common/MovePath.java +++ b/megamek/src/megamek/common/MovePath.java @@ -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() {