diff --git a/common/main/ai.h b/common/main/ai.h index 852538637..8a5c939d9 100644 --- a/common/main/ai.h +++ b/common/main/ai.h @@ -110,7 +110,6 @@ extern void init_robots_for_level(void); extern int ai_behavior_to_mode(int behavior); #if defined(DXX_BUILD_DESCENT_II) extern void create_path_to_segment(object *objp, int goalseg, int max_length, int safety_flag); -extern int ready_to_fire(robot_info *robptr, ai_local *ailp); extern int polish_path(object *objp, point_seg *psegs, int num_points); extern void move_towards_player(object *objp, vms_vector *vec_to_player); #endif diff --git a/d2x-rebirth/main/ai.c b/d2x-rebirth/main/ai.c index debfce2a6..1eaebd029 100644 --- a/d2x-rebirth/main/ai.c +++ b/d2x-rebirth/main/ai.c @@ -286,6 +286,18 @@ static const sbyte Ai_transition_table[AI_MAX_EVENT][AI_MAX_STATE][AI_MAX_STATE] } }; +// ---------------------------------------------------------------------------- +// Return firing status. +// If ready to fire a weapon, return true, else return false. +// Ready to fire a weapon if next_fire <= 0 or next_fire2 <= 0. +static int ready_to_fire(robot_info *robptr, ai_local *ailp) +{ + if (robptr->weapon_type2 != -1) + return (ailp->next_fire <= 0) || (ailp->next_fire2 <= 0); + else + return (ailp->next_fire <= 0); +} + // --------------------------------------------------------------------------------------------------------------------- // Given a behavior, set initial mode. int ai_behavior_to_mode(int behavior) @@ -2403,18 +2415,6 @@ void init_ai_frame(void) } } -// ---------------------------------------------------------------------------- -// Return firing status. -// If ready to fire a weapon, return true, else return false. -// Ready to fire a weapon if next_fire <= 0 or next_fire2 <= 0. -int ready_to_fire(robot_info *robptr, ai_local *ailp) -{ - if (robptr->weapon_type2 != -1) - return (ailp->next_fire <= 0) || (ailp->next_fire2 <= 0); - else - return (ailp->next_fire <= 0); -} - // ---------------------------------------------------------------------------- // Make a robot near the player snipe. #define MNRS_SEG_MAX 70