Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix multiple grounded dropship issues #2599

Merged
merged 3 commits into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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