Skip to content

Commit

Permalink
TestSupportVehicle: Prevent error when grounded for Fixed Wing type c…
Browse files Browse the repository at this point in the history
…hecking
  • Loading branch information
SJuliez committed Sep 12, 2023
1 parent d773452 commit 5c4b9dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion megamek/src/megamek/common/verifier/TestSupportVehicle.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,18 @@ static Set<SVType> 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
* a valid one for a support vehicle.
*/
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;
Expand Down

0 comments on commit 5c4b9dd

Please sign in to comment.