Skip to content

Commit 337b040

Browse files
committed
add ai_profiles flag to disable form-on-wing at mission start
By default, the player's wing will be issued a form-on-wing order at the beginning of the mission if the wing has no other initial goals. Wings in the "starting wings" list that are not the player's wing will also be issued this goal if they arrive after mission start and have no other initial goals. This PR adds a flag to disable this behavior.
1 parent 8ee9678 commit 337b040

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

code/ai/ai_flags.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ namespace AI {
180180
Freespace_1_missile_behavior,
181181
ETS_uses_power_output,
182182
ETS_energy_same_regardless_of_system_presence,
183+
Dont_form_on_wing_at_mission_start,
183184

184185
NUM_VALUES
185186
};

code/ai/ai_profiles.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ void parse_ai_profiles_tbl(const char *filename)
719719

720720
set_flag(profile, "$ETS energy same regardless of system presence:", AI::Profile_Flags::ETS_energy_same_regardless_of_system_presence);
721721

722+
set_flag(profile, "$don't issue form-on-wing goals at mission start:", AI::Profile_Flags::Dont_form_on_wing_at_mission_start);
723+
722724

723725
// end of options ----------------------------------------
724726

code/ai/aigoals.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ void ai_maybe_add_form_goal(wing* wingp)
197197
return;
198198
}
199199

200+
// we may simply not want the mission to do this
201+
if (The_mission.ai_profile->flags[AI::Profile_Flags::Dont_form_on_wing_at_mission_start]) {
202+
return;
203+
}
204+
200205
int j;
201206

202207
// iterate through the ship_index list of this wing and check for orders. We will do

0 commit comments

Comments
 (0)