2001-12-31 16:16:59 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//
|
2001-12-31 16:28:42 +00:00
|
|
|
// $Log$
|
2003-04-19 17:41:26 +00:00
|
|
|
// Revision 1.7 2003/04/19 17:41:26 jbravo
|
|
|
|
// Applied changes that where in 1.29h -> 1.32b gamecode.
|
|
|
|
//
|
2002-06-16 20:06:15 +00:00
|
|
|
// Revision 1.6 2002/06/16 20:06:14 jbravo
|
|
|
|
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
|
|
|
|
//
|
2002-01-11 19:48:33 +00:00
|
|
|
// Revision 1.5 2002/01/11 19:48:30 jbravo
|
|
|
|
// Formatted the source in non DOS format.
|
|
|
|
//
|
2001-12-31 16:28:42 +00:00
|
|
|
// Revision 1.4 2001/12/31 16:28:42 jbravo
|
|
|
|
// I made a Booboo with the Log tag.
|
|
|
|
//
|
2001-12-31 16:16:59 +00:00
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
2001-05-06 20:50:27 +00:00
|
|
|
// Copyright (C) 1999-2000 Id Software, Inc.
|
|
|
|
//
|
|
|
|
#include "g_local.h"
|
|
|
|
|
|
|
|
// this file is only included when building a dll
|
|
|
|
// g_syscalls.asm is included instead when building a qvm
|
2003-04-19 17:41:26 +00:00
|
|
|
#ifdef Q3_VM
|
|
|
|
#error "Do not use in VM build"
|
|
|
|
#endif
|
2001-05-06 20:50:27 +00:00
|
|
|
|
2011-03-07 03:59:31 +00:00
|
|
|
static intptr_t (QDECL *syscall)( intptr_t arg, ... ) = (intptr_t (QDECL *)( intptr_t, ...))-1;
|
2001-05-06 20:50:27 +00:00
|
|
|
|
2011-03-07 03:59:31 +00:00
|
|
|
Q_EXPORT void dllEntry( intptr_t (QDECL *syscallptr)( intptr_t arg,... ) ) {
|
2001-05-06 20:50:27 +00:00
|
|
|
syscall = syscallptr;
|
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int PASSFLOAT(float x)
|
|
|
|
{
|
2011-03-07 03:59:31 +00:00
|
|
|
floatint_t fi;
|
|
|
|
fi.f = x;
|
|
|
|
return fi.i;
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Printf(const char *fmt)
|
|
|
|
{
|
|
|
|
syscall(G_PRINT, fmt);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Error(const char *fmt)
|
|
|
|
{
|
|
|
|
syscall(G_ERROR, fmt);
|
2011-08-03 18:49:19 +00:00
|
|
|
exit(1);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_Milliseconds(void)
|
|
|
|
{
|
|
|
|
return syscall(G_MILLISECONDS);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_Argc(void)
|
|
|
|
{
|
|
|
|
return syscall(G_ARGC);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Argv(int n, char *buffer, int bufferLength)
|
|
|
|
{
|
|
|
|
syscall(G_ARGV, n, buffer, bufferLength);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_FS_FOpenFile(const char *qpath, fileHandle_t * f, fsMode_t mode)
|
|
|
|
{
|
|
|
|
return syscall(G_FS_FOPEN_FILE, qpath, f, mode);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_FS_Read(void *buffer, int len, fileHandle_t f)
|
|
|
|
{
|
|
|
|
syscall(G_FS_READ, buffer, len, f);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_FS_Write(const void *buffer, int len, fileHandle_t f)
|
|
|
|
{
|
|
|
|
syscall(G_FS_WRITE, buffer, len, f);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_FS_FCloseFile(fileHandle_t f)
|
|
|
|
{
|
|
|
|
syscall(G_FS_FCLOSE_FILE, f);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_FS_GetFileList(const char *path, const char *extension, char *listbuf, int bufsize)
|
|
|
|
{
|
|
|
|
return syscall(G_FS_GETFILELIST, path, extension, listbuf, bufsize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2003-04-19 17:41:26 +00:00
|
|
|
int trap_FS_Seek(fileHandle_t f, long offset, int origin)
|
|
|
|
{
|
|
|
|
return syscall(G_FS_SEEK, f, offset, origin);
|
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SendConsoleCommand(int exec_when, const char *text)
|
|
|
|
{
|
|
|
|
syscall(G_SEND_CONSOLE_COMMAND, exec_when, text);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Cvar_Register(vmCvar_t * cvar, const char *var_name, const char *value, int flags)
|
|
|
|
{
|
|
|
|
syscall(G_CVAR_REGISTER, cvar, var_name, value, flags);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Cvar_Update(vmCvar_t * cvar)
|
|
|
|
{
|
|
|
|
syscall(G_CVAR_UPDATE, cvar);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Cvar_Set(const char *var_name, const char *value)
|
|
|
|
{
|
|
|
|
syscall(G_CVAR_SET, var_name, value);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_Cvar_VariableIntegerValue(const char *var_name)
|
|
|
|
{
|
|
|
|
return syscall(G_CVAR_VARIABLE_INTEGER_VALUE, var_name);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Cvar_VariableStringBuffer(const char *var_name, char *buffer, int bufsize)
|
|
|
|
{
|
|
|
|
syscall(G_CVAR_VARIABLE_STRING_BUFFER, var_name, buffer, bufsize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_LocateGameData(gentity_t * gEnts, int numGEntities, int sizeofGEntity_t,
|
|
|
|
playerState_t * clients, int sizeofGClient)
|
|
|
|
{
|
|
|
|
syscall(G_LOCATE_GAME_DATA, gEnts, numGEntities, sizeofGEntity_t, clients, sizeofGClient);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_DropClient(int clientNum, const char *reason)
|
|
|
|
{
|
|
|
|
syscall(G_DROP_CLIENT, clientNum, reason);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SendServerCommand(int clientNum, const char *text)
|
|
|
|
{
|
|
|
|
syscall(G_SEND_SERVER_COMMAND, clientNum, text);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SetConfigstring(int num, const char *string)
|
|
|
|
{
|
|
|
|
syscall(G_SET_CONFIGSTRING, num, string);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_GetConfigstring(int num, char *buffer, int bufferSize)
|
|
|
|
{
|
|
|
|
syscall(G_GET_CONFIGSTRING, num, buffer, bufferSize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_GetUserinfo(int num, char *buffer, int bufferSize)
|
|
|
|
{
|
|
|
|
syscall(G_GET_USERINFO, num, buffer, bufferSize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SetUserinfo(int num, const char *buffer)
|
|
|
|
{
|
|
|
|
syscall(G_SET_USERINFO, num, buffer);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_GetServerinfo(char *buffer, int bufferSize)
|
|
|
|
{
|
|
|
|
syscall(G_GET_SERVERINFO, buffer, bufferSize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SetBrushModel(gentity_t * ent, const char *name)
|
|
|
|
{
|
|
|
|
syscall(G_SET_BRUSH_MODEL, ent, name);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Trace(trace_t * results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
|
|
|
|
int passEntityNum, int contentmask)
|
|
|
|
{
|
|
|
|
syscall(G_TRACE, results, start, mins, maxs, end, passEntityNum, contentmask);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_TraceCapsule(trace_t * results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end,
|
|
|
|
int passEntityNum, int contentmask)
|
|
|
|
{
|
|
|
|
syscall(G_TRACECAPSULE, results, start, mins, maxs, end, passEntityNum, contentmask);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_PointContents(const vec3_t point, int passEntityNum)
|
|
|
|
{
|
|
|
|
return syscall(G_POINT_CONTENTS, point, passEntityNum);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_InPVS(const vec3_t p1, const vec3_t p2)
|
|
|
|
{
|
|
|
|
return syscall(G_IN_PVS, p1, p2);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_InPVSIgnorePortals(const vec3_t p1, const vec3_t p2)
|
|
|
|
{
|
|
|
|
return syscall(G_IN_PVS_IGNORE_PORTALS, p1, p2);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_AdjustAreaPortalState(gentity_t * ent, qboolean open)
|
|
|
|
{
|
|
|
|
syscall(G_ADJUST_AREA_PORTAL_STATE, ent, open);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_AreasConnected(int area1, int area2)
|
|
|
|
{
|
|
|
|
return syscall(G_AREAS_CONNECTED, area1, area2);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_LinkEntity(gentity_t * ent)
|
|
|
|
{
|
|
|
|
syscall(G_LINKENTITY, ent);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_UnlinkEntity(gentity_t * ent)
|
|
|
|
{
|
|
|
|
syscall(G_UNLINKENTITY, ent);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_EntitiesInBox(const vec3_t mins, const vec3_t maxs, int *list, int maxcount)
|
|
|
|
{
|
|
|
|
return syscall(G_ENTITIES_IN_BOX, mins, maxs, list, maxcount);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_EntityContact(const vec3_t mins, const vec3_t maxs, const gentity_t * ent)
|
|
|
|
{
|
|
|
|
return syscall(G_ENTITY_CONTACT, mins, maxs, ent);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_EntityContactCapsule(const vec3_t mins, const vec3_t maxs, const gentity_t * ent)
|
|
|
|
{
|
|
|
|
return syscall(G_ENTITY_CONTACTCAPSULE, mins, maxs, ent);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotAllocateClient(void)
|
|
|
|
{
|
|
|
|
return syscall(G_BOT_ALLOCATE_CLIENT);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeClient(int clientNum)
|
|
|
|
{
|
|
|
|
syscall(G_BOT_FREE_CLIENT, clientNum);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_GetUsercmd(int clientNum, usercmd_t * cmd)
|
|
|
|
{
|
|
|
|
syscall(G_GET_USERCMD, clientNum, cmd);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
qboolean trap_GetEntityToken(char *buffer, int bufferSize)
|
|
|
|
{
|
|
|
|
return syscall(G_GET_ENTITY_TOKEN, buffer, bufferSize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_DebugPolygonCreate(int color, int numPoints, vec3_t * points)
|
|
|
|
{
|
|
|
|
return syscall(G_DEBUG_POLYGON_CREATE, color, numPoints, points);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_DebugPolygonDelete(int id)
|
|
|
|
{
|
|
|
|
syscall(G_DEBUG_POLYGON_DELETE, id);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_RealTime(qtime_t * qtime)
|
|
|
|
{
|
|
|
|
return syscall(G_REAL_TIME, qtime);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_SnapVector(float *v)
|
|
|
|
{
|
|
|
|
syscall(G_SNAPVECTOR, v);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// BotLib traps start here
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibSetup(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_SETUP);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibShutdown(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_SHUTDOWN);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibVarSet(char *var_name, char *value)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_LIBVAR_SET, var_name, value);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibVarGet(char *var_name, char *value, int size)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_LIBVAR_GET, var_name, value, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibDefine(char *string)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_PC_ADD_GLOBAL_DEFINE, string);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibStartFrame(float time)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_START_FRAME, PASSFLOAT(time));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibLoadMap(const char *mapname)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_LOAD_MAP, mapname);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibUpdateEntity(int ent, void /* struct bot_updateentity_s */ *bue)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_UPDATENTITY, ent, bue);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLibTest(int parm0, char *parm1, vec3_t parm2, vec3_t parm3)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_TEST, parm0, parm1, parm2, parm3);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetSnapshotEntity(int clientNum, int sequence)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_GET_SNAPSHOT_ENTITY, clientNum, sequence);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetServerCommand(int clientNum, char *message, int size)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_GET_CONSOLE_MESSAGE, clientNum, message, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotUserCommand(int clientNum, usercmd_t * ucmd)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_USER_COMMAND, clientNum, ucmd);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_AAS_EntityInfo(int entnum, void /* struct aas_entityinfo_s */ *info)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AAS_ENTITY_INFO, entnum, info);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_Initialized(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_INITIALIZED);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_AAS_PresenceTypeBoundingBox(int presencetype, vec3_t mins, vec3_t maxs)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AAS_PRESENCE_TYPE_BOUNDING_BOX, presencetype, mins, maxs);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
float trap_AAS_Time(void)
|
|
|
|
{
|
2011-03-07 03:59:31 +00:00
|
|
|
floatint_t fi;
|
|
|
|
fi.i = syscall( BOTLIB_AAS_TIME );
|
|
|
|
return fi.f;
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_PointAreaNum(vec3_t point)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_POINT_AREA_NUM, point);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_PointReachabilityAreaIndex(vec3_t point)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_POINT_REACHABILITY_AREA_INDEX, point);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_TraceAreas(vec3_t start, vec3_t end, int *areas, vec3_t * points, int maxareas)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_TRACE_AREAS, start, end, areas, points, maxareas);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_BBoxAreas(vec3_t absmins, vec3_t absmaxs, int *areas, int maxareas)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_BBOX_AREAS, absmins, absmaxs, areas, maxareas);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_AreaInfo(int areanum, void /* struct aas_areainfo_s */ *info)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_AREA_INFO, areanum, info);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_PointContents(vec3_t point)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_POINT_CONTENTS, point);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_NextBSPEntity(int ent)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_NEXT_BSP_ENTITY, ent);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_ValueForBSPEpairKey(int ent, char *key, char *value, int size)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_VALUE_FOR_BSP_EPAIR_KEY, ent, key, value, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_VectorForBSPEpairKey(int ent, char *key, vec3_t v)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_VECTOR_FOR_BSP_EPAIR_KEY, ent, key, v);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_FloatForBSPEpairKey(int ent, char *key, float *value)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_FLOAT_FOR_BSP_EPAIR_KEY, ent, key, value);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_IntForBSPEpairKey(int ent, char *key, int *value)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_INT_FOR_BSP_EPAIR_KEY, ent, key, value);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_AreaReachability(int areanum)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_AREA_REACHABILITY, areanum);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_AreaTravelTimeToGoalArea(int areanum, vec3_t origin, int goalareanum, int travelflags)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_AREA_TRAVEL_TIME_TO_GOAL_AREA, areanum, origin, goalareanum, travelflags);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_EnableRoutingArea(int areanum, int enable)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_ENABLE_ROUTING_AREA, areanum, enable);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_PredictRoute(void /*struct aas_predictroute_s */ *route, int areanum, vec3_t origin,
|
|
|
|
int goalareanum, int travelflags, int maxareas, int maxtime,
|
|
|
|
int stopevent, int stopcontents, int stoptfl, int stopareanum)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_PREDICT_ROUTE, route, areanum, origin, goalareanum, travelflags, maxareas, maxtime,
|
|
|
|
stopevent, stopcontents, stoptfl, stopareanum);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int trap_AAS_AlternativeRouteGoals(vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags,
|
2002-06-16 20:06:15 +00:00
|
|
|
void /*struct aas_altroutegoal_s */ *altroutegoals, int maxaltroutegoals,
|
|
|
|
int type)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_ALTERNATIVE_ROUTE_GOAL, start, startareanum, goal, goalareanum, travelflags,
|
|
|
|
altroutegoals, maxaltroutegoals, type);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_Swimming(vec3_t origin)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_SWIMMING, origin);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_AAS_PredictClientMovement(void /* struct aas_clientmove_s */ *move, int entnum, vec3_t origin,
|
|
|
|
int presencetype, int onground, vec3_t velocity, vec3_t cmdmove, int cmdframes,
|
|
|
|
int maxframes, float frametime, int stopevent, int stopareanum, int visualize)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AAS_PREDICT_CLIENT_MOVEMENT, move, entnum, origin, presencetype, onground, velocity,
|
|
|
|
cmdmove, cmdframes, maxframes, PASSFLOAT(frametime), stopevent, stopareanum, visualize);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Say(int client, char *str)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_SAY, client, str);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_SayTeam(int client, char *str)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_SAY_TEAM, client, str);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Command(int client, char *command)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_COMMAND, client, command);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Action(int client, int action)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_ACTION, client, action);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Gesture(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_GESTURE, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Talk(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_TALK, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Attack(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_ATTACK, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Use(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_USE, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Respawn(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_RESPAWN, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Crouch(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_CROUCH, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveUp(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_UP, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveDown(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_DOWN, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveForward(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_FORWARD, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveBack(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_BACK, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveLeft(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_LEFT, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_MoveRight(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE_RIGHT, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_SelectWeapon(int client, int weapon)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_SELECT_WEAPON, client, weapon);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Jump(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_JUMP, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_DelayedJump(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_DELAYED_JUMP, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_Move(int client, vec3_t dir, float speed)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_MOVE, client, dir, PASSFLOAT(speed));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_View(int client, vec3_t viewangles)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_VIEW, client, viewangles);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_EndRegular(int client, float thinktime)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_END_REGULAR, client, PASSFLOAT(thinktime));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_GetInput(int client, float thinktime, void /* struct bot_input_s */ *input)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_GET_INPUT, client, PASSFLOAT(thinktime), input);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_EA_ResetInput(int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_EA_RESET_INPUT, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLoadCharacter(char *charfile, float skill)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_LOAD_CHARACTER, charfile, PASSFLOAT(skill));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeCharacter(int character)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_CHARACTER, character);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
float trap_Characteristic_Float(int character, int index)
|
|
|
|
{
|
2011-03-07 03:59:31 +00:00
|
|
|
floatint_t fi;
|
2002-06-16 20:06:15 +00:00
|
|
|
|
2011-03-07 03:59:31 +00:00
|
|
|
fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_FLOAT, character, index );
|
|
|
|
return fi.f;
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
float trap_Characteristic_BFloat(int character, int index, float min, float max)
|
|
|
|
{
|
2011-03-07 03:59:31 +00:00
|
|
|
floatint_t fi;
|
2002-06-16 20:06:15 +00:00
|
|
|
|
2011-03-07 03:59:31 +00:00
|
|
|
fi.i = syscall( BOTLIB_AI_CHARACTERISTIC_BFLOAT, character, index, PASSFLOAT(min), PASSFLOAT(max) );
|
|
|
|
return fi.f;
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_Characteristic_Integer(int character, int index)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHARACTERISTIC_INTEGER, character, index);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_Characteristic_BInteger(int character, int index, int min, int max)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHARACTERISTIC_BINTEGER, character, index, min, max);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_Characteristic_String(int character, int index, char *buf, int size)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_CHARACTERISTIC_STRING, character, index, buf, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotAllocChatState(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_ALLOC_CHAT_STATE);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeChatState(int handle)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_CHAT_STATE, handle);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotQueueConsoleMessage(int chatstate, int type, char *message)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_QUEUE_CONSOLE_MESSAGE, chatstate, type, message);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotRemoveConsoleMessage(int chatstate, int handle)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_REMOVE_CONSOLE_MESSAGE, chatstate, handle);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotNextConsoleMessage(int chatstate, void /* struct bot_consolemessage_s */ *cm)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_NEXT_CONSOLE_MESSAGE, chatstate, cm);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotNumConsoleMessages(int chatstate)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_NUM_CONSOLE_MESSAGE, chatstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotInitialChat(int chatstate, char *type, int mcontext, char *var0, char *var1, char *var2, char *var3,
|
|
|
|
char *var4, char *var5, char *var6, char *var7)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_INITIAL_CHAT, chatstate, type, mcontext, var0, var1, var2, var3, var4, var5, var6, var7);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotNumInitialChats(int chatstate, char *type)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_NUM_INITIAL_CHATS, chatstate, type);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotReplyChat(int chatstate, char *message, int mcontext, int vcontext, char *var0, char *var1, char *var2,
|
|
|
|
char *var3, char *var4, char *var5, char *var6, char *var7)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_REPLY_CHAT, chatstate, message, mcontext, vcontext, var0, var1, var2, var3, var4, var5,
|
|
|
|
var6, var7);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotChatLength(int chatstate)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHAT_LENGTH, chatstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotEnterChat(int chatstate, int client, int sendto)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_ENTER_CHAT, chatstate, client, sendto);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotGetChatMessage(int chatstate, char *buf, int size)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_GET_CHAT_MESSAGE, chatstate, buf, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_StringContains(char *str1, char *str2, int casesensitive)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_STRING_CONTAINS, str1, str2, casesensitive);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotFindMatch(char *str, void /* struct bot_match_s */ *match, unsigned long int context)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_FIND_MATCH, str, match, context);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotMatchVariable(void /* struct bot_match_s */ *match, int variable, char *buf, int size)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_MATCH_VARIABLE, match, variable, buf, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_UnifyWhiteSpaces(char *string)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_UNIFY_WHITE_SPACES, string);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotReplaceSynonyms(char *string, unsigned long int context)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_REPLACE_SYNONYMS, string, context);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLoadChatFile(int chatstate, char *chatfile, char *chatname)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_LOAD_CHAT_FILE, chatstate, chatfile, chatname);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotSetChatGender(int chatstate, int gender)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_SET_CHAT_GENDER, chatstate, gender);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotSetChatName(int chatstate, char *name, int client)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_SET_CHAT_NAME, chatstate, name, client);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetGoalState(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_GOAL_STATE, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetAvoidGoals(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_AVOID_GOALS, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotRemoveFromAvoidGoals(int goalstate, int number)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_REMOVE_FROM_AVOID_GOALS, goalstate, number);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotPushGoal(int goalstate, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_PUSH_GOAL, goalstate, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotPopGoal(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_POP_GOAL, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotEmptyGoalStack(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_EMPTY_GOAL_STACK, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotDumpAvoidGoals(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_DUMP_AVOID_GOALS, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotDumpGoalStack(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_DUMP_GOAL_STACK, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotGoalName(int number, char *name, int size)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_GOAL_NAME, number, name, size);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetTopGoal(int goalstate, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GET_TOP_GOAL, goalstate, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetSecondGoal(int goalstate, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GET_SECOND_GOAL, goalstate, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotChooseLTGItem(int goalstate, vec3_t origin, int *inventory, int travelflags)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHOOSE_LTG_ITEM, goalstate, origin, inventory, travelflags);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotChooseNBGItem(int goalstate, vec3_t origin, int *inventory, int travelflags,
|
|
|
|
void /* struct bot_goal_s */ *ltg, float maxtime)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHOOSE_NBG_ITEM, goalstate, origin, inventory, travelflags, ltg, PASSFLOAT(maxtime));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotTouchingGoal(vec3_t origin, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_TOUCHING_GOAL, origin, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_ITEM_GOAL_IN_VIS_BUT_NOT_VISIBLE, viewer, eye, viewangles, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetLevelItemGoal(int index, char *classname, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GET_LEVEL_ITEM_GOAL, index, classname, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetNextCampSpotGoal(int num, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GET_NEXT_CAMP_SPOT_GOAL, num, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotGetMapLocationGoal(char *name, void /* struct bot_goal_s */ *goal)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GET_MAP_LOCATION_GOAL, name, goal);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
float trap_BotAvoidGoalTime(int goalstate, int number)
|
|
|
|
{
|
2011-03-07 03:59:31 +00:00
|
|
|
floatint_t fi;
|
2002-06-16 20:06:15 +00:00
|
|
|
|
2011-03-07 03:59:31 +00:00
|
|
|
fi.i = syscall( BOTLIB_AI_AVOID_GOAL_TIME, goalstate, number );
|
|
|
|
return fi.f;
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotSetAvoidGoalTime(int goalstate, int number, float avoidtime)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_SET_AVOID_GOAL_TIME, goalstate, number, PASSFLOAT(avoidtime));
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotInitLevelItems(void)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_INIT_LEVEL_ITEMS);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotUpdateEntityItems(void)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_UPDATE_ENTITY_ITEMS);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLoadItemWeights(int goalstate, char *filename)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_LOAD_ITEM_WEIGHTS, goalstate, filename);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeItemWeights(int goalstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_ITEM_WEIGHTS, goalstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_INTERBREED_GOAL_FUZZY_LOGIC, parent1, parent2, child);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotSaveGoalFuzzyLogic(int goalstate, char *filename)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_SAVE_GOAL_FUZZY_LOGIC, goalstate, filename);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotMutateGoalFuzzyLogic(int goalstate, float range)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_MUTATE_GOAL_FUZZY_LOGIC, goalstate, range);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotAllocGoalState(int state)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_ALLOC_GOAL_STATE, state);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeGoalState(int handle)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_GOAL_STATE, handle);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetMoveState(int movestate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_MOVE_STATE, movestate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_ADD_AVOID_SPOT, movestate, origin, PASSFLOAT(radius), type);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotMoveToGoal(void /* struct bot_moveresult_s */ *result, int movestate, void /* struct bot_goal_s */ *goal,
|
|
|
|
int travelflags)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_MOVE_TO_GOAL, result, movestate, goal, travelflags);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotMoveInDirection(int movestate, vec3_t dir, float speed, int type)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_MOVE_IN_DIRECTION, movestate, dir, PASSFLOAT(speed), type);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetAvoidReach(int movestate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_AVOID_REACH, movestate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetLastAvoidReach(int movestate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_LAST_AVOID_REACH, movestate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotReachabilityArea(vec3_t origin, int testground)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_REACHABILITY_AREA, origin, testground);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotMovementViewTarget(int movestate, void /* struct bot_goal_s */ *goal, int travelflags, float lookahead,
|
|
|
|
vec3_t target)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_MOVEMENT_VIEW_TARGET, movestate, goal, travelflags, PASSFLOAT(lookahead), target);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotPredictVisiblePosition(vec3_t origin, int areanum, void /* struct bot_goal_s */ *goal, int travelflags,
|
|
|
|
vec3_t target)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_PREDICT_VISIBLE_POSITION, origin, areanum, goal, travelflags, target);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotAllocMoveState(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_ALLOC_MOVE_STATE);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeMoveState(int handle)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_MOVE_STATE, handle);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotInitMoveState(int handle, void /* struct bot_initmove_s */ *initmove)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_INIT_MOVE_STATE, handle, initmove);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotChooseBestFightWeapon(int weaponstate, int *inventory)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_CHOOSE_BEST_FIGHT_WEAPON, weaponstate, inventory);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotGetWeaponInfo(int weaponstate, int weapon, void /* struct weaponinfo_s */ *weaponinfo)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_GET_WEAPON_INFO, weaponstate, weapon, weaponinfo);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotLoadWeaponWeights(int weaponstate, char *filename)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_LOAD_WEAPON_WEIGHTS, weaponstate, filename);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_BotAllocWeaponState(void)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_ALLOC_WEAPON_STATE);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotFreeWeaponState(int weaponstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_FREE_WEAPON_STATE, weaponstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
void trap_BotResetWeaponState(int weaponstate)
|
|
|
|
{
|
|
|
|
syscall(BOTLIB_AI_RESET_WEAPON_STATE, weaponstate);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_GeneticParentsAndChildSelection(int numranks, float *ranks, int *parent1, int *parent2, int *child)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_AI_GENETIC_PARENTS_AND_CHILD_SELECTION, numranks, ranks, parent1, parent2, child);
|
2001-05-06 20:50:27 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_PC_LoadSource(const char *filename)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_PC_LOAD_SOURCE, filename);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_PC_FreeSource(int handle)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_PC_FREE_SOURCE, handle);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_PC_ReadToken(int handle, pc_token_t * pc_token)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_PC_READ_TOKEN, handle, pc_token);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|
|
|
|
|
2002-06-16 20:06:15 +00:00
|
|
|
int trap_PC_SourceFileAndLine(int handle, char *filename, int *line)
|
|
|
|
{
|
|
|
|
return syscall(BOTLIB_PC_SOURCE_FILE_AND_LINE, handle, filename, line);
|
2001-08-01 19:52:17 +00:00
|
|
|
}
|