mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-10 14:52:08 +00:00
Recover gracefully from TF server cycling problem that sometimes doesn't
send the new map name, resulting in a crash. We now disconnect and go back to console.
This commit is contained in:
parent
61cfc6a5db
commit
f0d150104e
1 changed files with 11 additions and 5 deletions
|
@ -268,8 +268,7 @@ Model_NextDownload (void)
|
|||
}
|
||||
|
||||
cls.downloadtype = dl_model;
|
||||
for (; cl.model_name[cls.downloadnumber][0];
|
||||
cls.downloadnumber++) {
|
||||
for (; cl.model_name[cls.downloadnumber][0]; cls.downloadnumber++) {
|
||||
s = cl.model_name[cls.downloadnumber];
|
||||
if (s[0] == '*')
|
||||
continue; // inline brush model
|
||||
|
@ -284,9 +283,7 @@ Model_NextDownload (void)
|
|||
cl.model_precache[i] = Mod_ForName (cl.model_name[i], false);
|
||||
|
||||
if (!cl.model_precache[i]) {
|
||||
Con_Printf
|
||||
("\nThe required model file '%s' could not be found or downloaded.\n\n",
|
||||
cl.model_name[i]);
|
||||
Con_Printf ("\nThe required model file '%s' could not be found or downloaded.\n\n", cl.model_name[i]);
|
||||
Con_Printf ("You may need to download or purchase a %s client "
|
||||
"pack in order to play on this server.\n\n",
|
||||
gamedirfile);
|
||||
|
@ -295,6 +292,15 @@ Model_NextDownload (void)
|
|||
}
|
||||
}
|
||||
|
||||
// Something went wrong (probably in the server, probably a TF server)
|
||||
// We need to disconnect gracefully.
|
||||
if (!cl.model_precache[1]) {
|
||||
Con_Printf ("\nThe server has failed to provide the map name.\n\n");
|
||||
Con_Printf ("Disconnecting to prevent a crash.\n\n");
|
||||
CL_Disconnect ();
|
||||
return;
|
||||
}
|
||||
|
||||
// all done
|
||||
cl.worldmodel = cl.model_precache[1];
|
||||
R_NewMap ();
|
||||
|
|
Loading…
Reference in a new issue