Skip to content

Commit

Permalink
Merge pull request #2599 from NickAragua/fix_grounded_dropships
Browse files Browse the repository at this point in the history
fix multiple grounded dropship issues
  • Loading branch information
NickAragua authored May 10, 2021
2 parents 7bfeedc + 8010520 commit 2babc14
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
3 changes: 3 additions & 0 deletions MekHQ/data/scenariomodifiers/groundBattleModifiers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
<modifier>
EnemyDropship.xml
</modifier>
<modifier>
GroundedEnemyDropship.xml
</modifier>
<modifier>
GoodIntel.xml
</modifier>
Expand Down
3 changes: 3 additions & 0 deletions MekHQ/data/scenariomodifiers/modifiermanifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
<modifier>
EnemyDropship.xml
</modifier>
<modifier>
GroundedEnemyDropship.xml
</modifier>
<modifier>
GoodIntel.xml
</modifier>
Expand Down
10 changes: 9 additions & 1 deletion MekHQ/data/scenariotemplates/Defend Grounded Dropship.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@
<contributesToUnitCount>false</contributesToUnitCount>
<deployOffboard>false</deployOffboard>
<deploymentZones>
<deploymentZone>10</deploymentZone>
<deploymentZone>1</deploymentZone>
<deploymentZone>2</deploymentZone>
<deploymentZone>3</deploymentZone>
<deploymentZone>4</deploymentZone>
<deploymentZone>5</deploymentZone>
<deploymentZone>6</deploymentZone>
<deploymentZone>7</deploymentZone>
<deploymentZone>8</deploymentZone>
<deploymentZone>9</deploymentZone>
</deploymentZones>
<destinationZone>4</destinationZone>
<fixedUnitCount>0</fixedUnitCount>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
import megamek.common.Entity;
import megamek.common.EntityMovementMode;
import megamek.common.EntityWeightClass;
import megamek.common.IAero;
import megamek.common.IBomber;
import megamek.common.Infantry;
import megamek.common.Mech;
Expand Down Expand Up @@ -2301,8 +2302,14 @@ private static void deployArtilleryOffBoard(List<Entity> entityList) {
*/
private static void setStartingAltitude(List<Entity> entityList, int startingAltitude) {
for (Entity entity : entityList) {
if (!entity.hasETypeFlag(Entity.ETYPE_VTOL)) {
if (entity instanceof IAero) {
entity.setAltitude(startingAltitude);

// there's a lot of stuff that happens whan an aerospace unit
// "lands", so let's make sure it all happens
if (startingAltitude == 0) {
((IAero) entity).land();
}
}

entity.setElevation(startingAltitude);
Expand Down
6 changes: 5 additions & 1 deletion MekHQ/src/mekhq/gui/dialog/CustomizeScenarioDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ private void btnOKActionPerformed(ActionEvent evt) {
if (txtReport != null) {
scenario.setReport(txtReport.getText());
}
scenario.setStatus((ScenarioStatus) choiceStatus.getSelectedItem());

if (choiceStatus.getSelectedItem() != null) {
scenario.setStatus((ScenarioStatus) choiceStatus.getSelectedItem());
}

scenario.setDate(date);
}
scenario.resetLoot();
Expand Down

0 comments on commit 2babc14

Please sign in to comment.