Skip to content

Commit

Permalink
OB fix refs #33
Browse files Browse the repository at this point in the history
  • Loading branch information
IR4T4 committed May 7, 2012
1 parent a6e32cf commit 86a0b2c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 54 deletions.
53 changes: 53 additions & 0 deletions src/botlib/be_interface.c
Expand Up @@ -42,6 +42,7 @@

#include "../botlib/botlib.h"
#include "../game/be_aas.h"
#include "../game/be_ea.h"
#include "be_interface.h"

//library globals in a structure
Expand Down Expand Up @@ -122,6 +123,7 @@ qboolean BotLibSetup(char *str)
extern define_t *globaldefines;
int Export_BotLibSetup(qboolean singleplayer)
{
int errnum;

bot_developer = LibVarGetValue("bot_developer");
//initialize byte swapping (litte endian etc.)
Expand All @@ -133,6 +135,11 @@ int Export_BotLibSetup(qboolean singleplayer)
botlibglobals.maxentities = (int) LibVarValue("maxentities", "1024");


errnum = EA_Setup(); //be_ea.c
if ( errnum != BLERR_NOERROR ) {
return errnum;
}

globaldefines = NULL;

botlibsetup = qtrue;
Expand Down Expand Up @@ -161,6 +168,8 @@ int Export_BotLibShutdown(void)
}
recursive = 1;

EA_Shutdown();

// free all libvars
LibVarDeAllocAll();
// remove all global defines from the pre compiler
Expand Down Expand Up @@ -208,6 +217,47 @@ int Export_BotLibVarGet(char *var_name, char *value, int size)
return BLERR_NOERROR;
} //end of the function Export_BotLibVarGet


/*
============
Init_EA_Export
============
*/
static void Init_EA_Export( ea_export_t *ea ) {
//ClientCommand elementary actions
ea->EA_Say = EA_Say;
ea->EA_SayTeam = EA_SayTeam;
ea->EA_UseItem = EA_UseItem;
ea->EA_DropItem = EA_DropItem;
ea->EA_UseInv = EA_UseInv;
ea->EA_DropInv = EA_DropInv;
ea->EA_Gesture = EA_Gesture;
ea->EA_Command = EA_Command;
ea->EA_SelectWeapon = EA_SelectWeapon;
ea->EA_Talk = EA_Talk;
ea->EA_Attack = EA_Attack;
ea->EA_Reload = EA_Reload;
ea->EA_Use = EA_Use;
ea->EA_Respawn = EA_Respawn;
ea->EA_Jump = EA_Jump;
ea->EA_DelayedJump = EA_DelayedJump;
ea->EA_Crouch = EA_Crouch;
ea->EA_Walk = EA_Walk;
ea->EA_MoveUp = EA_MoveUp;
ea->EA_MoveDown = EA_MoveDown;
ea->EA_MoveForward = EA_MoveForward;
ea->EA_MoveBack = EA_MoveBack;
ea->EA_MoveLeft = EA_MoveLeft;
ea->EA_MoveRight = EA_MoveRight;
ea->EA_Move = EA_Move;
ea->EA_View = EA_View;
ea->EA_GetInput = EA_GetInput;
ea->EA_EndRegular = EA_EndRegular;
ea->EA_ResetInput = EA_ResetInput;
ea->EA_Prone = EA_Prone;
}


/*
============
GetBotLibAPI
Expand All @@ -224,6 +274,9 @@ botlib_export_t *GetBotLibAPI(int apiVersion, botlib_import_t *import)
botimport.Print(PRT_ERROR, "Mismatched BOTLIB_API_VERSION: expected %i, got %i\n", BOTLIB_API_VERSION, apiVersion);
return NULL;
}

Init_EA_Export( &be_botlib_export.ea );

be_botlib_export.BotLibSetup = Export_BotLibSetup;
be_botlib_export.BotLibShutdown = Export_BotLibShutdown;
be_botlib_export.BotLibVarSet = Export_BotLibVarSet;
Expand Down
54 changes: 0 additions & 54 deletions src/botlib/botlib.h
Expand Up @@ -301,57 +301,3 @@ typedef struct botlib_export_s
//linking of bot library
botlib_export_t *GetBotLibAPI(int apiVersion, botlib_import_t *import);

/* Library variables:
name: default: module(s): description:
"basedir" "" l_utils.c Quake2 base directory
"gamedir" "" l_utils.c Quake2 game directory
"cddir" "" l_utils.c Quake2 CD directory
"autolaunchbspc" "0" be_aas_load.c automatically launch (Win)BSPC
"log" "0" l_log.c enable/disable creating a log file
"maxclients" "4" be_interface.c maximum number of clients
"maxentities" "1024" be_interface.c maximum number of entities
"sv_friction" "6" be_aas_move.c ground friction
"sv_stopspeed" "100" be_aas_move.c stop speed
"sv_gravity" "800" be_aas_move.c gravity value
"sv_waterfriction" "1" be_aas_move.c water friction
"sv_watergravity" "400" be_aas_move.c gravity in water
"sv_maxvelocity" "300" be_aas_move.c maximum velocity
"sv_maxwalkvelocity" "300" be_aas_move.c maximum walk velocity
"sv_maxcrouchvelocity" "100" be_aas_move.c maximum crouch velocity
"sv_maxswimvelocity" "150" be_aas_move.c maximum swim velocity
"sv_walkaccelerate" "10" be_aas_move.c walk acceleration
"sv_airaccelerate" "1" be_aas_move.c air acceleration
"sv_swimaccelerate" "4" be_aas_move.c swim acceleration
"sv_maxstep" "18" be_aas_move.c maximum step height
"sv_maxbarrier" "32" be_aas_move.c maximum barrier height
"sv_maxsteepness" "0.7" be_aas_move.c maximum floor steepness
"sv_jumpvel" "270" be_aas_move.c jump z velocity
"sv_maxwaterjump" "20" be_aas_move.c maximum waterjump height
"max_aaslinks" "4096" be_aas_sample.c maximum links in the AAS
"max_bsplinks" "4096" be_aas_bsp.c maximum links in the BSP
"notspawnflags" "2048" be_ai_goal.c entities with these spawnflags will be removed
"itemconfig" "items.c" be_ai_goal.c item configuration file
"weaponconfig" "weapons.c" be_ai_weap.c weapon configuration file
"synfile" "syn.c" be_ai_chat.c file with synonyms
"rndfile" "rnd.c" be_ai_chat.c file with random strings
"matchfile" "match.c" be_ai_chat.c file with match strings
"max_messages" "1024" be_ai_chat.c console message heap size
"max_weaponinfo" "32" be_ai_weap.c maximum number of weapon info
"max_projectileinfo" "32" be_ai_weap.c maximum number of projectile info
"max_iteminfo" "256" be_ai_goal.c maximum number of item info
"max_levelitems" "256" be_ai_goal.c maximum number of level items
"framereachability" "" be_aas_reach.c number of reachabilities to calucate per frame
"forceclustering" "0" be_aas_main.c force recalculation of clusters
"forcereachability" "0" be_aas_main.c force recalculation of reachabilities
"forcewrite" "0" be_aas_main.c force writing of aas file
"nooptimize" "0" be_aas_main.c no aas optimization
"laserhook" "0" be_ai_move.c 0 = CTF hook, 1 = laser hook
*/

0 comments on commit 86a0b2c

Please sign in to comment.