aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--code/qcommon/files.c7
-rw-r--r--code/renderer/tr_flares.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index d20b3a1..2630a5c 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -2556,6 +2556,13 @@ FS_idPak
*/
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)) ) {
diff --git a/code/renderer/tr_flares.c b/code/renderer/tr_flares.c
index 0779e48..89a959c 100644
--- a/code/renderer/tr_flares.c
+++ b/code/renderer/tr_flares.c
@@ -354,7 +354,7 @@ void RB_RenderFlare( flare_t *f ) {
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 @@ void RB_RenderFlare( flare_t *f ) {
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;
}