Skip to content

Commit

Permalink
implement getHighestThresh() for LAMs
Browse files Browse the repository at this point in the history
  • Loading branch information
Algebro7 committed Aug 6, 2024
1 parent 7e1fc94 commit f2ebf5b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions megamek/src/megamek/common/LandAirMech.java
Original file line number Diff line number Diff line change
Expand Up @@ -1692,10 +1692,18 @@ public int getThresh(int loc) {
return getInternal(loc);
}

/**
* @return the highest damage threshold for the LAM unit
*/
@Override
public int getHighestThresh() {
// TODO: implement for StratOps Atmospheric Control Roll Errata
return 0;
int max = getThresh(0);
for (int i = 1; i < locations(); i++) {
if (getThresh(i) > max) {
max = getThresh(i);
}
}
return max;
}

@Override
Expand Down

0 comments on commit f2ebf5b

Please sign in to comment.