A fix for not being able to use extensions.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1502 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-10-19 19:37:16 +00:00
parent 3d531e6f45
commit f5290410c3

View file

@ -746,6 +746,7 @@ void SV_Modellist_f (void)
{ {
int i; int i;
unsigned n; unsigned n;
int maxclientsupportedmodels;
if (host_client->state != cs_connected) if (host_client->state != cs_connected)
{ {
@ -790,6 +791,10 @@ void SV_Modellist_f (void)
MSG_WriteByte (&host_client->netchan.message, n); MSG_WriteByte (&host_client->netchan.message, n);
} }
maxclientsupportedmodels = 256;
if (host_client->fteprotocolextensions & PEXT_MODELDBL)
maxclientsupportedmodels *= 2;
if (sv.democausesreconnect) //read the list from somewhere else if (sv.democausesreconnect) //read the list from somewhere else
{ {
for (i = 1+n; for (i = 1+n;
@ -803,14 +808,22 @@ void SV_Modellist_f (void)
else else
{ {
for (i = 1+n; for (i = 1+n;
sv.model_precache[i] && (((n&255)==0)||(host_client->netchan.message.cursize < (MAX_QWMSGLEN/2))); //make sure we don't send a 0 next... i < maxclientsupportedmodels && sv.model_precache[i] && host_client->netchan.message.cursize < (MAX_QWMSGLEN/2); //make sure we don't send a 0 next...
i++, n++) i++)
{
MSG_WriteString (&host_client->netchan.message, sv.model_precache[i]); MSG_WriteString (&host_client->netchan.message, sv.model_precache[i]);
if (((n&255)==255) && n != i-1)
break;
}
n = i-1;
if (!sv.model_precache[i]) if (!sv.model_precache[i])
n = 0; n = 0;
} }
if (i == maxclientsupportedmodels)
n = 0; //doh!
MSG_WriteByte (&host_client->netchan.message, 0); MSG_WriteByte (&host_client->netchan.message, 0);
// next msg // next msg
@ -908,7 +921,7 @@ void SV_PreSpawn_f (void)
MSG_WriteByte(&host_client->netchan.message, svc_spawnstatic2); MSG_WriteByte(&host_client->netchan.message, svc_spawnstatic2);
SV_WriteDelta(&from, state, &host_client->netchan.message, true, host_client->fteprotocolextensions); SV_WriteDelta(&from, state, &host_client->netchan.message, true, host_client->fteprotocolextensions);
} }
else else if (state->modelindex < 256)
{ {
MSG_WriteByte(&host_client->netchan.message, svc_spawnstatic); MSG_WriteByte(&host_client->netchan.message, svc_spawnstatic);
@ -961,13 +974,13 @@ void SV_PreSpawn_f (void)
MSG_WriteByte(&host_client->netchan.message, svc_spawnbaseline2); MSG_WriteByte(&host_client->netchan.message, svc_spawnbaseline2);
SV_WriteDelta(&from, state, &host_client->netchan.message, true, host_client->fteprotocolextensions); SV_WriteDelta(&from, state, &host_client->netchan.message, true, host_client->fteprotocolextensions);
} }
else else if (state->modelindex < 256)
{ {
MSG_WriteByte(&host_client->netchan.message, svc_spawnbaseline); MSG_WriteByte(&host_client->netchan.message, svc_spawnbaseline);
MSG_WriteShort (&host_client->netchan.message, buf - bufs - sv.numextrastatics); MSG_WriteShort (&host_client->netchan.message, buf - bufs - sv.numextrastatics);
MSG_WriteByte (&host_client->netchan.message, state->modelindex&255); MSG_WriteByte (&host_client->netchan.message, state->modelindex);
MSG_WriteByte (&host_client->netchan.message, state->frame); MSG_WriteByte (&host_client->netchan.message, state->frame);
MSG_WriteByte (&host_client->netchan.message, (int)state->colormap); MSG_WriteByte (&host_client->netchan.message, (int)state->colormap);
@ -1584,37 +1597,37 @@ qboolean SV_AllowDownload (char *name)
if (strchr(name, '\\')) //no windows paths - grow up lame windows users. if (strchr(name, '\\')) //no windows paths - grow up lame windows users.
return false; return false;
if (strncmp(name, "maps/", 5) == 0 && (allow_download_maps.value)) if (strncmp(name, "maps/", 5) == 0)
return true; return !!allow_download_maps.value;
//skins? //skins?
if (strncmp(name, "skins/", 6) == 0 && allow_download_skins.value) if (strncmp(name, "skins/", 6) == 0)
return true; return !!allow_download_skins.value;
//models //models
if ((strncmp(name, "progs/", 6) == 0|| if ((strncmp(name, "progs/", 6) == 0||
strncmp(name, "models/", 7) == 0) && allow_download_models.value) strncmp(name, "models/", 7) == 0))
return true; return !!allow_download_models.value;
//sound //sound
if (strncmp(name, "sound/", 6) == 0 && allow_download_sounds.value) if (strncmp(name, "sound/", 6) == 0)
return true; return !!allow_download_sounds.value;
//demos //demos
if (strncmp(name, "demos/", 6) == 0 && allow_download_demos.value) if (strncmp(name, "demos/", 6) == 0)
return true; return !!allow_download_demos.value;
//textures //textures
if (strncmp(name, "texures/", 8) == 0 && allow_download_textures.value) if (strncmp(name, "texures/", 8) == 0)
return true; return !!allow_download_textures.value;
//wads //wads
if (strncmp(name, "wads/", 5) == 0 && allow_download_wads.value) if (strncmp(name, "wads/", 5) == 0)
return true; return !!allow_download_wads.value;
if (!strcmp(".wad", COM_FileExtension(name)) && allow_download_wads.value) if (!strcmp(".wad", COM_FileExtension(name)))
return true; return !!allow_download_wads.value;
//pk3s. //pk3s.
if (!strcmp(".pk3", COM_FileExtension(name)) && allow_download_pk3s.value) if (!strcmp(".pk3", COM_FileExtension(name)))
if (strnicmp(name, "pak", 3)) //don't give out q3 pk3 files. if (strnicmp(name, "pak", 3)) //don't give out q3 pk3 files.
return true; return !!allow_download_pk3s.value;
//root of gamedir //root of gamedir
if (!strchr(name, '/') && !allow_download_root.value) if (!strchr(name, '/') && !allow_download_root.value)