Skip to content

Commit

Permalink
Merge pull request #5788 from Sleet01/Hotfix_let_Princess_bomb_again
Browse files Browse the repository at this point in the history
Revert unnecessary change that broke Princess bombing; add safety around diveBombing plans
  • Loading branch information
Sleet01 authored Jul 24, 2024
2 parents a04b96c + d101f3c commit 98bbd37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion megamek/src/megamek/client/bot/princess/FireControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -1933,9 +1933,10 @@ private FiringPlan getDiveBombPlan(final Entity shooter,
guess,
bombPayloads);
diveBombPlan.add(diveBomb);
//To prevent adding more than one dive bomb action to the plan
break;
}
}

return diveBombPlan;
}

Expand Down
8 changes: 4 additions & 4 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4313,7 +4313,7 @@ protected void resetBombAttacks() {
weaponBayList.removeAll(bombAttacksToRemove);

boolean foundSpaceBomb = false;
int numGroundBombs = 0;
int addedBombAttacks = 0;

for (BombMounted m : getBombs()) {
// Add the space bomb attack
Expand All @@ -4338,7 +4338,7 @@ && isBomber()
&& m.getType().hasFlag(AmmoType.F_GROUND_BOMB)
&& !((this instanceof LandAirMech)
&& (getConversionMode() == LandAirMech.CONV_MODE_MECH))) {
if (numGroundBombs <= 1) {
if (addedBombAttacks < 1) {
try {
WeaponMounted bomb = (WeaponMounted) addEquipment(diveBomb, m.getLocation(), false);
if (hasETypeFlag(ETYPE_FIGHTER_SQUADRON)) {
Expand All @@ -4350,7 +4350,7 @@ && isBomber()
}
}

if ((numGroundBombs <= 10) && isBomber()) {
if ((addedBombAttacks < 10) && isBomber()) {
try {
WeaponMounted bomb = (WeaponMounted) addEquipment(altBomb, m.getLocation(), false);
if (hasETypeFlag(ETYPE_FIGHTER_SQUADRON)) {
Expand All @@ -4361,7 +4361,7 @@ && isBomber()

}
}
numGroundBombs++;
addedBombAttacks++;
}
}
}
Expand Down

0 comments on commit 98bbd37

Please sign in to comment.