mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-01-31 13:00:52 +00:00
Don't redefine MAX_PATH in bot code
This commit is contained in:
parent
39b0702550
commit
815c898bf5
8 changed files with 14 additions and 30 deletions
|
@ -220,10 +220,9 @@ void AAS_ProjectPointOntoVector( vec3_t point, vec3_t vStart, vec3_t vEnd, vec3_
|
|||
int AAS_LoadFiles(const char *mapname)
|
||||
{
|
||||
int errnum;
|
||||
char aasfile[MAX_PATH];
|
||||
// char bspfile[MAX_PATH];
|
||||
char aasfile[MAX_QPATH];
|
||||
|
||||
strcpy(aasworld.mapname, mapname);
|
||||
Q_strncpyz(aasworld.mapname, mapname, sizeof(aasworld.mapname));
|
||||
//NOTE: first reset the entity links into the AAS areas and BSP leaves
|
||||
// the AAS link heap and BSP link heap are reset after respectively the
|
||||
// AAS file and BSP file are loaded
|
||||
|
@ -232,7 +231,7 @@ int AAS_LoadFiles(const char *mapname)
|
|||
AAS_LoadBSPFile();
|
||||
|
||||
//load the aas file
|
||||
Com_sprintf(aasfile, MAX_PATH, "maps/%s.aas", mapname);
|
||||
Com_sprintf(aasfile, sizeof(aasfile), "maps/%s.aas", mapname);
|
||||
errnum = AAS_LoadAASFile(aasfile);
|
||||
if (errnum != BLERR_NOERROR)
|
||||
return errnum;
|
||||
|
|
|
@ -268,7 +268,7 @@ itemconfig_t *LoadItemConfig(char *filename)
|
|||
{
|
||||
int max_iteminfo;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
source_t *source;
|
||||
itemconfig_t *ic;
|
||||
iteminfo_t *ii;
|
||||
|
|
|
@ -199,7 +199,7 @@ weaponconfig_t *LoadWeaponConfig(char *filename)
|
|||
{
|
||||
int max_weaponinfo, max_projectileinfo;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
int i, j;
|
||||
source_t *source;
|
||||
weaponconfig_t *wc;
|
||||
|
|
|
@ -971,7 +971,7 @@ int PC_Directive_include(source_t *source)
|
|||
{
|
||||
script_t *script;
|
||||
token_t token;
|
||||
char path[MAX_PATH];
|
||||
char path[MAX_QPATH];
|
||||
#ifdef QUAKE
|
||||
foundfile_t file;
|
||||
#endif //QUAKE
|
||||
|
|
|
@ -29,10 +29,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH MAX_QPATH
|
||||
#endif
|
||||
|
||||
#ifndef PATH_SEPERATORSTR
|
||||
#if defined(WIN32)|defined(_WIN32)|defined(__NT__)|defined(__WINDOWS__)|defined(__WINDOWS_386__)
|
||||
#define PATHSEPERATOR_STR "\\"
|
||||
|
|
|
@ -160,9 +160,7 @@ punctuation_t default_punctuations[] =
|
|||
{NULL, 0}
|
||||
};
|
||||
|
||||
#ifdef BSPC
|
||||
char basefolder[MAX_PATH];
|
||||
#else
|
||||
#ifdef BOTLIB
|
||||
char basefolder[MAX_QPATH];
|
||||
#endif
|
||||
|
||||
|
@ -1441,9 +1439,7 @@ void FreeScript(script_t *script)
|
|||
//============================================================================
|
||||
void PS_SetBaseFolder(char *path)
|
||||
{
|
||||
#ifdef BSPC
|
||||
sprintf(basefolder, path);
|
||||
#else
|
||||
#ifdef BOTLIB
|
||||
Com_sprintf(basefolder, sizeof(basefolder), "%s", path);
|
||||
#endif
|
||||
} //end of the function PS_SetBaseFolder
|
||||
|
|
|
@ -30,8 +30,5 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
*****************************************************************************/
|
||||
|
||||
#define Vector2Angles(v,a) vectoangles(v,a)
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH MAX_QPATH
|
||||
#endif
|
||||
#define Maximum(x,y) (x > y ? x : y)
|
||||
#define Minimum(x,y) (x < y ? x : y)
|
||||
|
|
|
@ -55,10 +55,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include "inv.h"
|
||||
#include "syn.h"
|
||||
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 144
|
||||
#endif
|
||||
|
||||
|
||||
//bot states
|
||||
bot_state_t *botstates[MAX_CLIENTS];
|
||||
|
@ -1174,7 +1170,7 @@ BotAISetupClient
|
|||
==============
|
||||
*/
|
||||
int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean restart) {
|
||||
char filename[MAX_PATH], name[MAX_PATH], gender[MAX_PATH];
|
||||
char filename[144], name[144], gender[144];
|
||||
bot_state_t *bs;
|
||||
int errnum;
|
||||
|
||||
|
@ -1206,7 +1202,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a goal state
|
||||
bs->gs = trap_BotAllocGoalState(client);
|
||||
//load the item weights
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_ITEMWEIGHTS, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_ITEMWEIGHTS, filename, sizeof(filename));
|
||||
errnum = trap_BotLoadItemWeights(bs->gs, filename);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeGoalState(bs->gs);
|
||||
|
@ -1215,7 +1211,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a weapon state
|
||||
bs->ws = trap_BotAllocWeaponState();
|
||||
//load the weapon weights
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_WEAPONWEIGHTS, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_WEAPONWEIGHTS, filename, sizeof(filename));
|
||||
errnum = trap_BotLoadWeaponWeights(bs->ws, filename);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeGoalState(bs->gs);
|
||||
|
@ -1225,8 +1221,8 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
//allocate a chat state
|
||||
bs->cs = trap_BotAllocChatState();
|
||||
//load the chat file
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_FILE, filename, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_NAME, name, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_FILE, filename, sizeof(filename));
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_CHAT_NAME, name, sizeof(name));
|
||||
errnum = trap_BotLoadChatFile(bs->cs, filename, name);
|
||||
if (errnum != BLERR_NOERROR) {
|
||||
trap_BotFreeChatState(bs->cs);
|
||||
|
@ -1235,7 +1231,7 @@ int BotAISetupClient(int client, struct bot_settings_s *settings, qboolean resta
|
|||
return qfalse;
|
||||
}
|
||||
//get the gender characteristic
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_GENDER, gender, MAX_PATH);
|
||||
trap_Characteristic_String(bs->character, CHARACTERISTIC_GENDER, gender, sizeof(gender));
|
||||
//set the chat gender
|
||||
if (*gender == 'f' || *gender == 'F') trap_BotSetChatGender(bs->cs, CHAT_GENDERFEMALE);
|
||||
else if (*gender == 'm' || *gender == 'M') trap_BotSetChatGender(bs->cs, CHAT_GENDERMALE);
|
||||
|
|
Loading…
Reference in a new issue