Skip to content

Commit

Permalink
ensure_crewed: check cclass still matches
Browse files Browse the repository at this point in the history
For now this is a "can't happen", but planned features will allow a
 bombertype's crew requirements to change.
  • Loading branch information
ec429 committed May 18, 2015
1 parent 64dae98 commit 3d9bb81
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions control.c
Original file line number Diff line number Diff line change
Expand Up @@ -1564,11 +1564,12 @@ bool ensure_crewed(game *state, unsigned int i)
if(types[type].crew[j]==CCLASS_NONE)
continue;
int k=state->bombers[i].crew[j];
if(k>=0 && ((state->crews[k].skill*filter_elite<50*filter_elite) ||
(state->bombers[i].pff&&(CREWOPS(k)<types[type].noarm?30:15)) ||
((filter_student==1)&&CREWOPS(k))))
// 0. Deassign current crewman if unsuitable
if(k>=0 && ((state->crews[k].skill*filter_elite<50*filter_elite) || // 'elite' filter
(state->bombers[i].pff&&(CREWOPS(k)<types[type].noarm?30:15)) || // PFF requirements
((filter_student==1)&&CREWOPS(k)) || // 'student' filter
state->crews[k].class!=types[type].crew[j])) // cclass changed under us
{
// deassign
state->crews[k].assignment=-1;
state->bombers[i].crew[j]=-1;
}
Expand Down

0 comments on commit 3d9bb81

Please sign in to comment.