Skip to content

Commit

Permalink
added check so princess will unjam only if expected damage is 5 or more
Browse files Browse the repository at this point in the history
  • Loading branch information
DM0000 committed Nov 6, 2024
1 parent 001bcc4 commit 4c6c5cf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions megamek/src/megamek/client/bot/princess/Princess.java
Original file line number Diff line number Diff line change
Expand Up @@ -3006,7 +3006,7 @@ private MovePath performPathPostProcessing(MovePath path, double expectedDamage)
turnOnSearchLight(retVal, expectedDamage >= 0);
unloadTransportedInfantry(retVal);
launchFighters(retVal);
unjamRAC(retVal);
unjamRAC(retVal, expectedDamage >= 5 );

// if we are using vector movement, there's a whole bunch of post-processing that happens to
// aircraft flight paths when a player does it, so we apply it here.
Expand All @@ -3021,10 +3021,10 @@ private MovePath performPathPostProcessing(MovePath path, double expectedDamage)
* Helper function that appends an unjam RAC command to the end of a qualifying path.
* @param path The path to process.
*/
private void unjamRAC(MovePath path) {
private void unjamRAC(MovePath path, boolean expectFiveOrMore) {
if (path.getEntity().canUnjamRAC() &&
(path.getMpUsed() <= path.getEntity().getWalkMP()) &&
!path.isJumping()) {
!path.isJumping() && !expectFiveOrMore) {
path.addStep(MoveStepType.UNJAM_RAC);
}
}
Expand Down

0 comments on commit 4c6c5cf

Please sign in to comment.