Skip to content
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
15 changes: 6 additions & 9 deletions src/game/mc2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,19 +853,13 @@ void MissionSetup(char plr, char mis)
MH[j][i] = eq;
} // for (i<7)

// TODO: This is a backstop against unexpected behavior.
// MissionType.Hard[Mission_EVA] is initialized to 0.
// However, it ought to be set in the VAB explicitly. As the
// VAB _should_ stop any EVA missions from proceeding this
// protects against the mission Hard[] field not being
// properly initialized until the VAB EVA assignment is
// improved.
MH[j][Mission_EVA] = &Data->P[plr].Misc[MISC_HW_EVA_SUITS];

// Photo Recon isn't included in MissionType.Hard - it's
// always available.
MH[j][Mission_PhotoRecon] =
&Data->P[plr].Misc[MISC_HW_PHOTO_RECON];
// Photo Recon should never be damaged.
MH[j][Mission_PhotoRecon]->MisSaf =
MH[j][Mission_PhotoRecon]->Safety;
} // for (j<2)

if (DMFake == 1) {
Expand Down Expand Up @@ -957,6 +951,9 @@ void MissionSetDown(char plr, char mis)
/**
* Compute and apply safety penalties to mission steps.
*
* This should only be called after MissionSetup() so the global array
* MH[][] will be populated.
*
* \param plr the index of the current player
* \param mission the mission plan with configured Days duration.
*/
Expand Down
7 changes: 7 additions & 0 deletions src/game/vab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,13 @@ void ReserveHardware(int plr, int pad, int payload, Vehicle &rocket)
}
}

if (IsManned(Data->P[plr].Mission[pad].MissionCode) &&
Data->P[plr].Misc[MISC_HW_EVA_SUITS].Num != PROGRAM_NOT_STARTED) {
Data->P[plr].Mission[pad].Hard[Mission_EVA] = MISC_HW_EVA_SUITS;
} else {
Data->P[plr].Mission[pad].Hard[Mission_EVA] = -1;
}

rocket.assignTo(pad);
}

Expand Down