fix to master cvars, don't crash when worldmodel doesn't get loaded for the client, misc fixes

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2296 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-05-25 21:32:32 +00:00
parent 116faaf0c9
commit 31eaf52ce9
4 changed files with 7 additions and 12 deletions

View file

@ -605,11 +605,6 @@ void Model_NextDownload (void)
CL_AllowIndependantSendCmd(false); //stop it now, the indep stuff *could* require model tracing. CL_AllowIndependantSendCmd(false); //stop it now, the indep stuff *could* require model tracing.
// if (cl.worldmodel->type != mod_brush && cl.worldmodel->type != mod_heightmap)
// Host_EndGame("Worldmodel must be a bsp of some sort\n");
Hunk_Check (); // make sure nothing is hurt Hunk_Check (); // make sure nothing is hurt
cl.sendprespawn = true; cl.sendprespawn = true;
@ -696,7 +691,7 @@ int CL_LoadModels(int stage)
if (atstage()) if (atstage())
{ {
cl.worldmodel = cl.model_precache[1]; cl.worldmodel = cl.model_precache[1];
if (!cl.worldmodel) if (!cl.worldmodel || cl.worldmodel->type == mod_dummy)
Host_EndGame("Worldmodel wasn't sent\n"); Host_EndGame("Worldmodel wasn't sent\n");
R_CheckSky(); R_CheckSky();
@ -713,7 +708,7 @@ int CL_LoadModels(int stage)
if (atstage()) if (atstage())
{ {
loadmodel = cl.worldmodel; loadmodel = cl.worldmodel;
if (!loadmodel) if (!loadmodel || loadmodel->type == mod_dummy)
Host_EndGame("No worldmodel was loaded\n"); Host_EndGame("No worldmodel was loaded\n");
if (R_PreNewMap) if (R_PreNewMap)
@ -724,7 +719,7 @@ int CL_LoadModels(int stage)
if (atstage()) if (atstage())
{ {
loadmodel = cl.worldmodel; loadmodel = cl.worldmodel;
if (!loadmodel) if (!loadmodel || loadmodel->type == mod_dummy)
Host_EndGame("No worldmodel was loaded\n"); Host_EndGame("No worldmodel was loaded\n");
Mod_NowLoadExternal(); Mod_NowLoadExternal();
@ -736,7 +731,7 @@ int CL_LoadModels(int stage)
if (atstage()) if (atstage())
{ {
loadmodel = cl.worldmodel; loadmodel = cl.worldmodel;
if (!loadmodel) if (!loadmodel || loadmodel->type == mod_dummy)
Host_EndGame("No worldmodel was loaded\n"); Host_EndGame("No worldmodel was loaded\n");
R_NewMap (); R_NewMap ();

View file

@ -454,7 +454,7 @@ void SV_Map_f (void)
return; return;
} }
strcpy (level, Cmd_Argv(1)); Q_strncpyz (level, Cmd_Argv(1), sizeof(level));
startspot = ((Cmd_Argc() == 2)?NULL:Cmd_Argv(2)); startspot = ((Cmd_Argc() == 2)?NULL:Cmd_Argv(2));
waschangelevel = !strcmp(Cmd_Argv(0), "changelevel"); waschangelevel = !strcmp(Cmd_Argv(0), "changelevel");

View file

@ -3258,7 +3258,7 @@ void SV_Masterlist_Callback(struct cvar_s *var, char *oldvalue)
if (!sv_masterlist[i].cv.name) if (!sv_masterlist[i].cv.name)
return; return;
if (*var->string) if (!*var->string)
{ {
sv_masterlist[i].adr.port = 0; sv_masterlist[i].adr.port = 0;
return; return;

View file

@ -67,7 +67,7 @@ qbyte Trans(qbyte p, qbyte p2)
qbyte AddBlend(qbyte p, qbyte p2) qbyte AddBlend(qbyte p, qbyte p2)
{ {
int x, y; unsigned int x, y;
x = (srctable[p] + dsttable[p2]); x = (srctable[p] + dsttable[p2]);
y = x & 0x40100400; // overflow bits y = x & 0x40100400; // overflow bits