attenuation = MSG_ReadByte(&cl_message) / 64.0;
else
attenuation = DEFAULT_SOUND_PACKET_ATTENUATION;
-
+
speed = 1.0f;
ent = (channel>>3)&1023;
{
for (j = 0;j < 6;j++)
bits[j] = MSG_ReadByte(&cl_message);
- if (cl.qw_num_nails > 255)
+ if (cl.qw_num_nails >= 255)
continue;
v = cl.qw_nails[cl.qw_num_nails++];
v[0] = ( ( bits[0] + ((bits[1]&15)<<8) ) <<1) - 4096;
return;
}
- if(debugPolys.begin_vertices > VMPOLYGONS_MAXPOINTS)
+ if(debugPolys.begin_vertices >= VMPOLYGONS_MAXPOINTS)
{
Con_Printf("Debug_PolygonVertex: may have %i vertices max\n", VMPOLYGONS_MAXPOINTS);
return;
trans_sortarraysize = r_transparent_sortarraysize.integer;
if (trans_hash)
Mem_Free(trans_hash);
- trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(trans_hash) * trans_sortarraysize);
+ trans_hash = (meshqueue_t **)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t *) * trans_sortarraysize);
if (trans_hashpointer)
Mem_Free(trans_hashpointer);
- trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(trans_hashpointer) * trans_sortarraysize);
+ trans_hashpointer = (meshqueue_t ***)Mem_Alloc(cls.permanentmempool, sizeof(meshqueue_t **) * trans_sortarraysize);
}
// build index
- memset(trans_hash, 0, sizeof(trans_hash) * trans_sortarraysize);
+ memset(trans_hash, 0, sizeof(meshqueue_t *) * trans_sortarraysize);
for (i = 0; i < trans_sortarraysize; i++)
trans_hashpointer[i] = &trans_hash[i];
distscale = (trans_sortarraysize - 1) / min(mqt_viewmaxdist, r_transparent_sortmaxdist.integer);
for (i = 0;i < (int)sizeof(value);i++)
if (value[i] != ';' && value[i] != '\\' && value[i] != '/' && value[i] != ':')
break;
- if (value[i])
+ if (i < (int)sizeof(value) && value[i])
{
for (;i < (int)sizeof(value);i++)
{
str = PRVM_G_STRING( OFS_PARM2 );
masknr = (int)PRVM_G_FLOAT( OFS_PARM0 );
- if( masknr >= 0 && masknr <= SERVERLIST_ANDMASKCOUNT )
+ if( masknr >= 0 && masknr < SERVERLIST_ANDMASKCOUNT )
mask = &serverlist_andmasks[masknr];
- else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
+ else if( masknr >= 512 && masknr - 512 < SERVERLIST_ORMASKCOUNT )
mask = &serverlist_ormasks[masknr - 512 ];
else
{
VM_SAFEPARMCOUNT( 4, VM_M_setserverlistmasknumber );
masknr = (int)PRVM_G_FLOAT( OFS_PARM0 );
- if( masknr >= 0 && masknr <= SERVERLIST_ANDMASKCOUNT )
+ if( masknr >= 0 && masknr < SERVERLIST_ANDMASKCOUNT )
mask = &serverlist_andmasks[masknr];
- else if( masknr >= 512 && masknr - 512 <= SERVERLIST_ORMASKCOUNT )
+ else if( masknr >= 512 && masknr - 512 < SERVERLIST_ORMASKCOUNT )
mask = &serverlist_ormasks[masknr - 512 ];
else
{
lighttris++;
shadowtris = 0;
- if (rtlight->static_numlighttrispvsbytes)
+ if (rtlight->static_numshadowtrispvsbytes)
for (i = 0;i < rtlight->static_numshadowtrispvsbytes*8;i++)
if (CHECKPVSBIT(rtlight->static_shadowtrispvs, i))
shadowtris++;