FS2_Open
Open source remastering of the Freespace 2 engine
ai.cpp File Reference
#include "ai/ai.h"
#include "object/object.h"
#include "ship/ship.h"

Go to the source code of this file.

Functions

int ai_get_slot (int shipnum)
 Returns index of free AI slot. More...
 
void ai_free_slot (int ai_index)
 Frees a currently used AI slot. More...
 
int get_wingnum (int objnum)
 
void set_wingnum (int objnum, int wingnum)
 
char * ai_get_goal_target_name (const char *name, int *index)
 

Variables

int Total_goal_target_names = 0
 
char Goal_target_names [MAX_GOAL_TARGET_NAMES][NAME_LENGTH]
 
ai_info Ai_info [MAX_AI_INFO]
 
ai_infoPlayer_ai
 

Detailed Description

The code in here is just for bookeeping, allocating AI slots and linking them to ships. See AiCode.cpp for the actual AI code.

Definition in file ai.cpp.

Function Documentation

void ai_free_slot ( int  ai_index)

Frees a currently used AI slot.

Only modifies in Ai_info struct. Does not modify hook in ship.

Definition at line 50 of file ai.cpp.

char* ai_get_goal_target_name ( const char *  name,
int index 
)

Definition at line 85 of file ai.cpp.

int ai_get_slot ( int  shipnum)

Returns index of free AI slot.

Returns
Return -1 if no free slot.

Definition at line 30 of file ai.cpp.

int get_wingnum ( int  objnum)

Definition at line 57 of file ai.cpp.

void set_wingnum ( int  objnum,
int  wingnum 
)

Definition at line 68 of file ai.cpp.

Variable Documentation

ai_info Ai_info[MAX_AI_INFO]

Definition at line 23 of file ai.cpp.

char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH]

Definition at line 22 of file ai.cpp.

ai_info* Player_ai

Definition at line 24 of file ai.cpp.

int Total_goal_target_names = 0

Definition at line 21 of file ai.cpp.