From 5c4b9dd5079fe279498b7ea9c4f0a32a7e9ef9db Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 12 Sep 2023 23:40:46 +0200 Subject: [PATCH] TestSupportVehicle: Prevent error when grounded for Fixed Wing type checking --- megamek/src/megamek/common/verifier/TestSupportVehicle.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/megamek/src/megamek/common/verifier/TestSupportVehicle.java b/megamek/src/megamek/common/verifier/TestSupportVehicle.java index 0bd6fd63b84..3bda4d48c5d 100644 --- a/megamek/src/megamek/common/verifier/TestSupportVehicle.java +++ b/megamek/src/megamek/common/verifier/TestSupportVehicle.java @@ -84,7 +84,7 @@ static Set allBut(SVType first, SVType... rest) { } /** - * Finds the enum value corresponding to a support vehicle based on movement mode. + * Finds the enum value corresponding to a support vehicle. * * @param entity The support vehicle * @return The support vehicle type, or {@code null} if the entity's movement type is not @@ -92,6 +92,10 @@ static Set allBut(SVType first, SVType... rest) { */ public static @Nullable SVType getVehicleType(Entity entity) { + // When grounded, FWS revert to wheeled movement mode; must be independent of this + if (entity instanceof FixedWingSupport) { + return FIXED_WING; + } switch (entity.getMovementMode()) { case AIRSHIP: return AIRSHIP;