mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +00:00
In CL_ParseServerInfo(), call Host_Error() when a model can't be found.
This prevents the segmentation fault reported by Spirit at http://celephais.net/board/view_thread.php?id=60452&start=516. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@877 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
cf71ddf358
commit
63e5a4c82b
1 changed files with 8 additions and 12 deletions
|
@ -270,8 +270,8 @@ void CL_ParseServerInfo (void)
|
||||||
i = MSG_ReadLong ();
|
i = MSG_ReadLong ();
|
||||||
//johnfitz -- support multiple protocols
|
//johnfitz -- support multiple protocols
|
||||||
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE) {
|
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE) {
|
||||||
Con_Printf ("\n"); //becuase there's no newline after serverinfo print
|
Con_Printf ("\n"); //because there's no newline after serverinfo print
|
||||||
Host_Error ("Server returned version %i, not %i or %i\n", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE);
|
Host_Error ("Server returned version %i, not %i or %i", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE);
|
||||||
}
|
}
|
||||||
cl.protocol = i;
|
cl.protocol = i;
|
||||||
//johnfitz
|
//johnfitz
|
||||||
|
@ -280,8 +280,7 @@ void CL_ParseServerInfo (void)
|
||||||
cl.maxclients = MSG_ReadByte ();
|
cl.maxclients = MSG_ReadByte ();
|
||||||
if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD)
|
if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD)
|
||||||
{
|
{
|
||||||
Con_Printf("Bad maxclients (%u) from server\n", cl.maxclients);
|
Host_Error ("Bad maxclients (%u) from server", cl.maxclients);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
cl.scores = (scoreboard_t *) Hunk_AllocName (cl.maxclients*sizeof(*cl.scores), "scores");
|
cl.scores = (scoreboard_t *) Hunk_AllocName (cl.maxclients*sizeof(*cl.scores), "scores");
|
||||||
|
|
||||||
|
@ -312,8 +311,7 @@ void CL_ParseServerInfo (void)
|
||||||
break;
|
break;
|
||||||
if (nummodels==MAX_MODELS)
|
if (nummodels==MAX_MODELS)
|
||||||
{
|
{
|
||||||
Con_Printf ("Server sent too many model precaches\n");
|
Host_Error ("Server sent too many model precaches");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
q_strlcpy (model_precache[nummodels], str, MAX_QPATH);
|
q_strlcpy (model_precache[nummodels], str, MAX_QPATH);
|
||||||
Mod_TouchModel (str);
|
Mod_TouchModel (str);
|
||||||
|
@ -333,8 +331,7 @@ void CL_ParseServerInfo (void)
|
||||||
break;
|
break;
|
||||||
if (numsounds==MAX_SOUNDS)
|
if (numsounds==MAX_SOUNDS)
|
||||||
{
|
{
|
||||||
Con_Printf ("Server sent too many sound precaches\n");
|
Host_Error ("Server sent too many sound precaches");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
q_strlcpy (sound_precache[numsounds], str, MAX_QPATH);
|
q_strlcpy (sound_precache[numsounds], str, MAX_QPATH);
|
||||||
S_TouchSound (str);
|
S_TouchSound (str);
|
||||||
|
@ -357,8 +354,7 @@ void CL_ParseServerInfo (void)
|
||||||
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
|
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
|
||||||
if (cl.model_precache[i] == NULL)
|
if (cl.model_precache[i] == NULL)
|
||||||
{
|
{
|
||||||
Con_Printf("Model %s not found\n", model_precache[i]);
|
Host_Error ("Model %s not found", model_precache[i]);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
CL_KeepaliveMessage ();
|
CL_KeepaliveMessage ();
|
||||||
}
|
}
|
||||||
|
@ -962,7 +958,7 @@ void CL_ParseServerMessage (void)
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
Host_Error ("Illegible server message, previous was %s\n", svc_strings[lastcmd]); //johnfitz -- added svc_strings[lastcmd]
|
Host_Error ("Illegible server message, previous was %s", svc_strings[lastcmd]); //johnfitz -- added svc_strings[lastcmd]
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case svc_nop:
|
case svc_nop:
|
||||||
|
@ -982,7 +978,7 @@ void CL_ParseServerMessage (void)
|
||||||
i = MSG_ReadLong ();
|
i = MSG_ReadLong ();
|
||||||
//johnfitz -- support multiple protocols
|
//johnfitz -- support multiple protocols
|
||||||
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE)
|
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE)
|
||||||
Host_Error ("Server returned version %i, not %i or %i\n", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE);
|
Host_Error ("Server returned version %i, not %i or %i", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE);
|
||||||
cl.protocol = i;
|
cl.protocol = i;
|
||||||
//johnfitz
|
//johnfitz
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue