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
1 change: 1 addition & 0 deletions code/ai/ai_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ namespace AI {
Dont_limit_change_in_speed_due_to_physics_whack,
Guards_ignore_protected_attackers,
Fix_standard_strafe,
Fix_target_updating_with_strafe,
Standard_strafe_used_more,
Unify_usage_ai_shield_manage_delay,
Fix_AI_shield_management_bug,
Expand Down
4 changes: 4 additions & 0 deletions code/ai/ai_profiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,8 @@ void parse_ai_profiles_tbl(const char *filename)

set_flag(profile, "$fix standard strafe:", AI::Profile_Flags::Fix_standard_strafe);

set_flag(profile, "$fix target updating with strafe:", AI::Profile_Flags::Fix_target_updating_with_strafe);
Comment thread
Goober5000 marked this conversation as resolved.

set_flag(profile, "$standard strafe used more:", AI::Profile_Flags::Standard_strafe_used_more);

if (optional_string("$standard strafe triggers under this speed:")) {
Expand Down Expand Up @@ -987,5 +989,7 @@ void ai_profile_t::reset()
flags.set(AI::Profile_Flags::Fix_big_ship_waypoint_completion);
flags.set(AI::Profile_Flags::Fix_shockwave_expire_before_do_damage);
flags.set(AI::Profile_Flags::Fix_small_ai_recover_after_engines_repaired);
flags.set(AI::Profile_Flags::Fix_standard_strafe);
flags.set(AI::Profile_Flags::Fix_target_updating_with_strafe);
}
}
9 changes: 7 additions & 2 deletions code/ai/aicode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15513,8 +15513,13 @@ void ai_frame(int objnum)
En_objp = NULL;
}

if (aip->mode == AIM_CHASE) {
if (En_objp == NULL) {
if (aip->mode == AIM_CHASE || ((The_mission.ai_profile->flags[AI::Profile_Flags::Fix_target_updating_with_strafe]) && aip->mode == AIM_STRAFE)) {
// If we're chasing or strafing against large ship but have lost our target, clear the active goal
// to ensure ai_process_mission_orders() re-evaluates our orders next frame.
// Without this fighter/bomber whose strafe target is destroyed drops to AIM_NONE (see ai_execute_behavior)
// with its active_goal still set, so a standing order like attack-any is never re-processed
// and the ship slows to zero and remains still until another order is issued.
if (En_objp == nullptr) {
aip->active_goal = -1;
}
}
Expand Down
Loading