r718 - in trunk/code: qcommon renderer
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Sat Apr 22 14:24:50 EDT 2006
Author: thilo
Date: 2006-04-22 14:24:50 -0400 (Sat, 22 Apr 2006)
New Revision: 718
Modified:
trunk/code/qcommon/files.c
trunk/code/renderer/tr_flares.c
Log:
Fix prohibits illegal downloading of id PK3 files from servers. That bug is hit by *every* official server release from ID.
Modified: trunk/code/qcommon/files.c
===================================================================
--- trunk/code/qcommon/files.c 2006-04-22 15:57:43 UTC (rev 717)
+++ trunk/code/qcommon/files.c 2006-04-22 18:24:50 UTC (rev 718)
@@ -2556,7 +2556,14 @@
*/
qboolean FS_idPak( char *pak, char *base ) {
int i;
+ char pakbuf[MAX_QPATH], *pakptr;
+ // Chop off filename extension if necessary.
+ Com_sprintf(pakbuf, sizeof(pakbuf), "%s", pak);
+ pakptr = Q_strrchr(pakbuf, '.');
+ if(pakptr)
+ *pakptr = '\0';
+
for (i = 0; i < NUM_ID_PAKS; i++) {
if ( !FS_FilenameCompare(pak, va("%s/pak%d", base, i)) ) {
break;
Modified: trunk/code/renderer/tr_flares.c
===================================================================
--- trunk/code/renderer/tr_flares.c 2006-04-22 15:57:43 UTC (rev 717)
+++ trunk/code/renderer/tr_flares.c 2006-04-22 18:24:50 UTC (rev 718)
@@ -354,7 +354,7 @@
VectorScale(f->color, f->drawIntensity * tr.identityLight * intensity, color);
// Calculations for fogging
- if(f->fogNum < tr.world->numfogs)
+ if(tr.world && f->fogNum < tr.world->numfogs)
{
tess.numVertexes = 1;
VectorCopy(f->origin, tess.xyz[0]);
@@ -363,7 +363,7 @@
RB_CalcModulateColorsByFog(fogFactors);
// We don't need to render the flare if colors are 0 anyways.
- if(!fogFactors[0] && !fogFactors[1] && !fogFactors[2])
+ if(!(fogFactors[0] || fogFactors[1] || fogFactors[2]))
return;
}
More information about the quake3-commits
mailing list