Commit 3abf8e3e authored by Rinnegatamante's avatar Rinnegatamante
Browse files

Updated to latest ioquake3 commit.

parent e46316dd
......@@ -226,6 +226,9 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
p1 = BotGoalStateFromHandle(parent1);
p2 = BotGoalStateFromHandle(parent2);
c = BotGoalStateFromHandle(child);
if (!p1 || !p2 || !c)
return;
InterbreedWeightConfigs(p1->itemweightconfig, p2->itemweightconfig,
c->itemweightconfig);
......@@ -239,7 +242,7 @@ void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child)
void BotSaveGoalFuzzyLogic(int goalstate, char *filename)
{
//bot_goalstate_t *gs;
//if (!gs) return;
//gs = BotGoalStateFromHandle(goalstate);
//WriteWeightConfig(filename, gs->itemweightconfig);
......@@ -255,7 +258,7 @@ void BotMutateGoalFuzzyLogic(int goalstate, float range)
bot_goalstate_t *gs;
gs = BotGoalStateFromHandle(goalstate);
if (!gs) return;
EvolveWeightConfig(gs->itemweightconfig);
} //end of the function BotMutateGoalFuzzyLogic
//===========================================================================
......@@ -894,6 +897,7 @@ int BotGetLevelItemGoal(int index, char *name, bot_goal_t *goal)
goal->number = li->number;
goal->flags = GFL_ITEM;
if (li->timeout) goal->flags |= GFL_DROPPED;
goal->iteminfo = li->iteminfo;
//botimport.Print(PRT_MESSAGE, "found li %s\n", itemconfig->iteminfo[li->iteminfo].name);
return li->number;
} //end if
......@@ -920,6 +924,9 @@ int BotGetMapLocationGoal(char *name, bot_goal_t *goal)
goal->entitynum = 0;
VectorCopy(mins, goal->mins);
VectorCopy(maxs, goal->maxs);
goal->number = 0;
goal->flags = 0;
goal->iteminfo = 0;
return qtrue;
} //end if
} //end for
......@@ -948,6 +955,9 @@ int BotGetNextCampSpotGoal(int num, bot_goal_t *goal)
goal->entitynum = 0;
VectorCopy(mins, goal->mins);
VectorCopy(maxs, goal->maxs);
goal->number = 0;
goal->flags = 0;
goal->iteminfo = 0;
return num+1;
} //end if
} //end for
......
......@@ -1802,8 +1802,14 @@ int CG_ClientNumFromName(const char *p) {
}
void CG_ShowResponseHead(void) {
Menus_OpenByName("voiceMenu");
trap_Cvar_Set("cl_conXOffset", "72");
float x, y, w, h;
x = 72;
y = w = h = 0;
CG_AdjustFrom640( &x, &y, &w, &h );
Menus_OpenByName("voiceMenu");
trap_Cvar_Set("cl_conXOffset", va("%d", (int)x));
cg.voiceTime = cg.time;
}
......
......@@ -498,7 +498,7 @@ void S_Init( void )
Cmd_AddCommand( "s_stop", S_StopAllSounds );
Cmd_AddCommand( "s_info", S_SoundInfo );
cv = Cvar_Get( "s_useOpenAL", "1", CVAR_ARCHIVE );
cv = Cvar_Get( "s_useOpenAL", "1", CVAR_ARCHIVE | CVAR_LATCH);
if( cv->integer ) {
//OpenAL
started = S_AL_Init( &si );
......
......@@ -320,11 +320,15 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) {
client = ent->client;
if ( client->sess.spectatorState != SPECTATOR_FOLLOW ) {
if ( client->noclip ) {
client->ps.pm_type = PM_NOCLIP;
if ( client->sess.spectatorState != SPECTATOR_FOLLOW || !( client->ps.pm_flags & PMF_FOLLOW ) ) {
if ( client->sess.spectatorState == SPECTATOR_FREE ) {
if ( client->noclip ) {
client->ps.pm_type = PM_NOCLIP;
} else {
client->ps.pm_type = PM_SPECTATOR;
}
} else {
client->ps.pm_type = PM_SPECTATOR;
client->ps.pm_type = PM_FREEZE;
}
client->ps.speed = 400; // faster than normal
......@@ -1074,14 +1078,17 @@ void SpectatorClientEndFrame( gentity_t *ent ) {
ent->client->ps.pm_flags |= PMF_FOLLOW;
ent->client->ps.eFlags = flags;
return;
} else {
// drop them to free spectators unless they are dedicated camera followers
if ( ent->client->sess.spectatorClient >= 0 ) {
ent->client->sess.spectatorState = SPECTATOR_FREE;
ClientBegin( ent->client - level.clients );
}
}
}
if ( ent->client->ps.pm_flags & PMF_FOLLOW ) {
// drop them to free spectators unless they are dedicated camera followers
if ( ent->client->sess.spectatorClient >= 0 ) {
ent->client->sess.spectatorState = SPECTATOR_FREE;
}
ClientBegin( ent->client - level.clients );
}
}
if ( ent->client->sess.spectatorState == SPECTATOR_SCOREBOARD ) {
......
......@@ -1141,7 +1141,7 @@ qboolean CanDamage (gentity_t *targ, vec3_t origin) {
VectorCopy(midpoint, dest);
dest[0] += offsetmins[0];
dest[1] += offsetmins[2];
dest[1] += offsetmins[1];
dest[2] += offsetmins[2];
trap_Trace(&tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
......
......@@ -320,11 +320,15 @@ void SpectatorThink( gentity_t *ent, usercmd_t *ucmd ) {
client = ent->client;
if ( client->sess.spectatorState != SPECTATOR_FOLLOW ) {
if ( client->noclip ) {
client->ps.pm_type = PM_NOCLIP;
if ( client->sess.spectatorState != SPECTATOR_FOLLOW || !( client->ps.pm_flags & PMF_FOLLOW ) ) {
if ( client->sess.spectatorState == SPECTATOR_FREE ) {
if ( client->noclip ) {
client->ps.pm_type = PM_NOCLIP;
} else {
client->ps.pm_type = PM_SPECTATOR;
}
} else {
client->ps.pm_type = PM_SPECTATOR;
client->ps.pm_type = PM_FREEZE;
}
client->ps.speed = 400; // faster than normal
......@@ -1074,14 +1078,17 @@ void SpectatorClientEndFrame( gentity_t *ent ) {
ent->client->ps.pm_flags |= PMF_FOLLOW;
ent->client->ps.eFlags = flags;
return;
} else {
// drop them to free spectators unless they are dedicated camera followers
if ( ent->client->sess.spectatorClient >= 0 ) {
ent->client->sess.spectatorState = SPECTATOR_FREE;
ClientBegin( ent->client - level.clients );
}
}
}
if ( ent->client->ps.pm_flags & PMF_FOLLOW ) {
// drop them to free spectators unless they are dedicated camera followers
if ( ent->client->sess.spectatorClient >= 0 ) {
ent->client->sess.spectatorState = SPECTATOR_FREE;
}
ClientBegin( ent->client - level.clients );
}
}
if ( ent->client->sess.spectatorState == SPECTATOR_SCOREBOARD ) {
......
......@@ -1141,7 +1141,7 @@ qboolean CanDamage (gentity_t *targ, vec3_t origin) {
VectorCopy(midpoint, dest);
dest[0] += offsetmins[0];
dest[1] += offsetmins[2];
dest[1] += offsetmins[1];
dest[2] += offsetmins[2];
trap_Trace(&tr, origin, vec3_origin, vec3_origin, dest, ENTITYNUM_NONE, MASK_SOLID);
......
......@@ -689,9 +689,7 @@ void Cmd_RemoveCommand( const char *cmd_name ) {
}
if ( !strcmp( cmd_name, cmd->name ) ) {
*back = cmd->next;
if (cmd->name) {
Z_Free(cmd->name);
}
Z_Free(cmd->name);
Z_Free (cmd);
return;
}
......
......@@ -2495,20 +2495,23 @@ void FS_GetModDescription( const char *modDir, char *description, int descriptio
int nDescLen;
FILE *file;
Com_sprintf( descPath, sizeof ( descPath ), "%s/description.txt", modDir );
Com_sprintf( descPath, sizeof ( descPath ), "%s%cdescription.txt", modDir, PATH_SEP );
nDescLen = FS_SV_FOpenFileRead( descPath, &descHandle );
if ( nDescLen > 0 && descHandle ) {
if ( nDescLen > 0 ) {
file = FS_FileForHandle(descHandle);
Com_Memset( description, 0, descriptionLen );
nDescLen = fread(description, 1, descriptionLen, file);
if (nDescLen >= 0) {
description[nDescLen] = '\0';
}
FS_FCloseFile(descHandle);
} else {
Q_strncpyz( description, modDir, descriptionLen );
}
if ( descHandle ) {
FS_FCloseFile( descHandle );
}
}
/*
......
......@@ -512,6 +512,10 @@ void UI_DrawProportionalString( int x, int y, const char* str, int style, vec4_t
int width;
float sizeScale;
if( !str ) {
return;
}
sizeScale = UI_ProportionalSizeScale( style );
switch( style & UI_FORMATMASK ) {
......
......@@ -138,12 +138,10 @@ void UI_LoadArenas( void ) {
char filename[128];
char dirlist[1024];
char* dirptr;
int i, n;
int i;
int dirlen;
char *type;
ui_numArenas = 0;
uiInfo.mapCount = 0;
trap_Cvar_Register( &arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM );
if( *arenasFile.string ) {
......@@ -166,7 +164,19 @@ void UI_LoadArenas( void ) {
if (UI_OutOfMemory()) {
trap_Print(S_COLOR_YELLOW"WARNING: not enough memory in pool to load all arenas\n");
}
}
/*
===============
UI_LoadArenasIntoMapList
===============
*/
void UI_LoadArenasIntoMapList( void ) {
int n;
char *type;
uiInfo.mapCount = 0;
for( n = 0; n < ui_numArenas; n++ ) {
// determine type
......
......@@ -359,6 +359,7 @@ int UI_AdjustTimeByGame(int time);
void UI_ShowPostGame(qboolean newHigh);
void UI_ClearScores( void );
void UI_LoadArenas(void);
void UI_LoadArenasIntoMapList(void);
//
// ui_menu.c
......
......@@ -1751,16 +1751,10 @@ static int UI_OwnerDrawWidth(int ownerDraw, float scale) {
static void UI_DrawBotName(rectDef_t *rect, float scale, vec4_t color, int textStyle) {
int value = uiInfo.botIndex;
int game = trap_Cvar_VariableValue("g_gametype");
const char *text = "";
const char *text;
if (game >= GT_TEAM) {
if (value >= uiInfo.characterCount) {
value = 0;
}
text = uiInfo.characterList[value].name;
} else {
if (value >= UI_GetNumBots()) {
value = 0;
}
text = UI_GetBotNameByNumber(value);
}
Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle);
......@@ -2548,16 +2542,16 @@ static qboolean UI_BotName_HandleKey(int flags, float *special, int key) {
value += select;
if (game >= GT_TEAM) {
if (value >= uiInfo.characterCount + 2) {
if (value >= uiInfo.characterCount) {
value = 0;
} else if (value < 0) {
value = uiInfo.characterCount + 2 - 1;
value = uiInfo.characterCount - 1;
}
} else {
if (value >= UI_GetNumBots() + 2) {
if (value >= UI_GetNumBots()) {
value = 0;
} else if (value < 0) {
value = UI_GetNumBots() + 2 - 1;
value = UI_GetNumBots() - 1;
}
}
uiInfo.botIndex = value;
......@@ -3263,6 +3257,7 @@ static void UI_RunMenuScript(char **args) {
trap_Cvar_Set("ui_cdkeyvalid", "CD Key does not appear to be valid.");
}
} else if (Q_stricmp(name, "loadArenas") == 0) {
UI_LoadArenasIntoMapList();
UI_MapCountByGameType(qfalse);
Menu_SetFeederSelection(NULL, FEEDER_ALLMAPS, 0, "createserver");
} else if (Q_stricmp(name, "saveControls") == 0) {
......
......@@ -3547,8 +3547,15 @@ qboolean Item_Bind_HandleKey(itemDef_t *item, int key, qboolean down) {
case K_BACKSPACE:
id = BindingIDFromName(item->cvar);
if (id != -1) {
g_bindings[id].bind1 = -1;
g_bindings[id].bind2 = -1;
if( g_bindings[id].bind1 != -1 ) {
g_bindings[id].bind2 = -1;
DC->setBinding( g_bindings[id].bind1, "" );
g_bindings[id].bind1 = -1;
}
if( g_bindings[id].bind2 != -1 ) {
DC->setBinding( g_bindings[id].bind2, "" );
g_bindings[id].bind2 = -1;
}
}
Controls_SetConfig(qtrue);
g_waitingForKey = qfalse;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment