Commit e46316dd authored by Rinnegatamante's avatar Rinnegatamante
Browse files

Updated to latest ioquake3 commit.

parent ff5e3e58
......@@ -609,7 +609,7 @@ static unsigned int yuv_to_rgb24( long y, long u, long v )
if (g > 255) g = 255;
if (b > 255) b = 255;
return LittleLong ((r)|(g<<8)|(b<<16)|(255<<24));
return LittleLong ((unsigned long)((r)|(g<<8)|(b<<16))|(255UL<<24));
}
/******************************************************************************
......
......@@ -301,6 +301,7 @@ void CL_cURL_BeginDownload( const char *localName, const char *remoteURL )
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_MAXREDIRS, 5);
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_PROTOCOLS,
CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FTP | CURLPROTO_FTPS);
qcurl_easy_setopt_warn(clc.downloadCURL, CURLOPT_BUFFERSIZE, CURL_MAX_READ_SIZE);
clc.downloadCURLM = qcurl_multi_init();
if(!clc.downloadCURLM) {
qcurl_easy_cleanup(clc.downloadCURL);
......
......@@ -1478,9 +1478,10 @@ void CL_LoadConsoleHistory( void )
return;
}
if( consoleSaveBufferSize <= MAX_CONSOLE_SAVE_BUFFER &&
if( consoleSaveBufferSize < MAX_CONSOLE_SAVE_BUFFER &&
FS_Read( consoleSaveBuffer, consoleSaveBufferSize, f ) == consoleSaveBufferSize )
{
consoleSaveBuffer[consoleSaveBufferSize] = '\0';
text_p = consoleSaveBuffer;
for( i = COMMAND_HISTORY - 1; i >= 0; i-- )
......
......@@ -141,7 +141,7 @@ static int ResampleSfx( sfx_t *sfx, int channels, int inrate, int inwidth, int s
if( inwidth == 2 ) {
sample = ( ((short *)data)[srcsample+j] );
} else {
sample = (int)( (unsigned char)(data[srcsample+j]) - 128) << 8;
sample = (unsigned int)( (unsigned char)(data[srcsample+j]) - 128) << 8;
}
part = (i*channels+j)&(SND_CHUNK_SIZE-1);
if (part == 0) {
......
......@@ -900,7 +900,8 @@ static void S_AL_NewLoopMaster(src_t *rmSource, qboolean iskilled)
S_AL_SaveLoopPos(rmSource, rmSource->alSource);
}
}
else if(rmSource == &srcList[curSfx->masterLoopSrc])
else if(curSfx->masterLoopSrc != -1 &&
rmSource == &srcList[curSfx->masterLoopSrc])
{
int firstInactive = -1;
......
......@@ -276,7 +276,7 @@ winding_t *CopyWinding (winding_t *w)
winding_t *c;
c = AllocWinding (w->numpoints);
size = (intptr_t) ((winding_t *)0)->p[w->numpoints];
size = (intptr_t)&(w->p[w->numpoints]) - (intptr_t)w;
Com_Memcpy (c, w, size);
return c;
}
......
......@@ -568,7 +568,13 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
Com_Printf ("%s is write protected.\n", var_name);
return var;
}
if ( (var->flags & CVAR_CHEAT) && !cvar_cheats->integer )
{
Com_Printf ("%s is cheat protected.\n", var_name);
return var;
}
if (var->flags & CVAR_LATCH)
{
if (var->latchedString)
......@@ -590,12 +596,6 @@ cvar_t *Cvar_Set2( const char *var_name, const char *value, qboolean force ) {
return var;
}
if ( (var->flags & CVAR_CHEAT) && !cvar_cheats->integer )
{
Com_Printf ("%s is cheat protected.\n", var_name);
return var;
}
}
else
{
......
......@@ -3463,17 +3463,18 @@ static void FS_CheckPak0( void )
{
searchpath_t *path;
pack_t *curpack;
const char *pakBasename;
qboolean founddemo = qfalse;
unsigned int foundPak = 0, foundTA = 0;
for( path = fs_searchpaths; path; path = path->next )
{
const char* pakBasename = path->pack->pakBasename;
if(!path->pack)
continue;
curpack = path->pack;
pakBasename = curpack->pakBasename;
if(!Q_stricmpn( curpack->pakGamename, "demoq3", MAX_OSPATH )
&& !Q_stricmpn( pakBasename, "pak0", MAX_OSPATH ))
......
......@@ -239,7 +239,7 @@ int MSG_ReadBits( msg_t *msg, int bits ) {
for(i=0;i<bits;i+=8) {
Huff_offsetReceive (msgHuff.decompressor.tree, &get, msg->data, &msg->bit, msg->cursize<<3);
// fwrite(&get, 1, 1, fp);
value |= (get<<(i+nbits));
value = (unsigned int)value | ((unsigned int)get<<(i+nbits));
if (msg->bit > msg->cursize<<3) {
msg->readcount = msg->cursize + 1;
......@@ -462,12 +462,14 @@ char *MSG_ReadString( msg_t *msg ) {
if ( c > 127 ) {
c = '.';
}
string[l] = c;
l++;
} while (l < sizeof(string)-1);
// break only after reading all expected data from bitstream
if ( l >= sizeof(string)-1 ) {
break;
}
string[l++] = c;
} while (1);
string[l] = 0;
string[l] = '\0';
return string;
}
......@@ -490,12 +492,14 @@ char *MSG_ReadBigString( msg_t *msg ) {
if ( c > 127 ) {
c = '.';
}
string[l] = c;
l++;
} while (l < sizeof(string)-1);
// break only after reading all expected data from bitstream
if ( l >= sizeof(string)-1 ) {
break;
}
string[l++] = c;
} while (1);
string[l] = 0;
string[l] = '\0';
return string;
}
......@@ -518,12 +522,14 @@ char *MSG_ReadStringLine( msg_t *msg ) {
if ( c > 127 ) {
c = '.';
}
string[l] = c;
l++;
} while (l < sizeof(string)-1);
// break only after reading all expected data from bitstream
if ( l >= sizeof(string)-1 ) {
break;
}
string[l++] = c;
} while (1);
string[l] = 0;
string[l] = '\0';
return string;
}
......
......@@ -303,7 +303,7 @@ static int fdOffset;
static byte *fdFile;
int readInt( void ) {
int i = fdFile[fdOffset]+(fdFile[fdOffset+1]<<8)+(fdFile[fdOffset+2]<<16)+(fdFile[fdOffset+3]<<24);
int i = ((unsigned int)fdFile[fdOffset] | ((unsigned int)fdFile[fdOffset+1]<<8) | ((unsigned int)fdFile[fdOffset+2]<<16) | ((unsigned int)fdFile[fdOffset+3]<<24));
fdOffset += 4;
return i;
}
......
......@@ -414,7 +414,7 @@ int R_MarkFragments( int numPoints, const vec3_t *points, const vec3_t projectio
indexes = (int *)( (byte *)surf + surf->ofsIndices );
for ( k = 0 ; k < surf->numIndices ; k += 3 ) {
for ( j = 0 ; j < 3 ; j++ ) {
v = surf->points[0] + VERTEXSIZE * indexes[k+j];;
v = &surf->points[0][0] + VERTEXSIZE * indexes[k+j];
VectorMA( v, MARKER_OFFSET, surf->plane.normal, clipPoints[0][j] );
}
......
......@@ -671,12 +671,7 @@ void SV_DropClient( client_t *drop, const char *reason ) {
if ( isBot ) {
SV_BotFreeClient( drop - svs.clients );
}
// nuke user info
SV_SetUserinfo( drop - svs.clients, "" );
if ( isBot ) {
// bots shouldn't go zombie, as there's no real net connection.
drop->state = CS_FREE;
} else {
......@@ -684,6 +679,9 @@ void SV_DropClient( client_t *drop, const char *reason ) {
drop->state = CS_ZOMBIE; // become free in a few seconds
}
// nuke user info
SV_SetUserinfo( drop - svs.clients, "" );
// if this was the last client on the server, send a heartbeat
// to the master so it is known the server is empty
// send a heartbeat now so the master will get up to date info
......@@ -1948,7 +1946,7 @@ void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
}
// if we can tell that the client has dropped the last
// gamestate we sent them, resend it
if ( cl->messageAcknowledge > cl->gamestateMessageNum ) {
if ( cl->state != CS_ACTIVE && cl->messageAcknowledge > cl->gamestateMessageNum ) {
Com_DPrintf( "%s : dropped gamestate, resending\n", cl->name );
SV_SendClientGameState( cl );
}
......
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