diff --git a/nq/source/cl_parse.c b/nq/source/cl_parse.c index e23a35513..2fd67bedf 100644 --- a/nq/source/cl_parse.c +++ b/nq/source/cl_parse.c @@ -218,6 +218,22 @@ CL_KeepaliveMessage (void) SZ_Clear (&cls.message); } +void CL_NewMap (const char *mapname) +{ + char *name = malloc (strlen (mapname) + 4 + 1); + + + R_NewMap (cl.worldmodel, cl.model_precache, MAX_MODELS); + Con_NewMap (); + + COM_StripExtension (mapname, name); + strcat (name, ".cfg"); + Cbuf_AddText (host_cbuf, "exec "); + Cbuf_AddText (host_cbuf, name); + Cbuf_AddText (host_cbuf, "\n"); + free (name); +} + void CL_ParseServerInfo (void) { @@ -310,9 +326,7 @@ CL_ParseServerInfo (void) // local state cl_entities[0].model = cl.worldmodel = cl.model_precache[1]; - - R_NewMap (cl.worldmodel, cl.model_precache, MAX_MODELS); - Con_NewMap (); + CL_NewMap (model_precache[1]); Hunk_Check (); // make sure nothing is hurt diff --git a/qw/source/cl_parse.c b/qw/source/cl_parse.c index 190096741..c6e25e7fd 100644 --- a/qw/source/cl_parse.c +++ b/qw/source/cl_parse.c @@ -246,6 +246,23 @@ CL_CheckOrDownloadFile (const char *filename) return false; } +void CL_NewMap (const char *mapname) +{ + char *name = malloc (strlen (mapname) + 4 + 1); + + R_NewMap (cl.worldmodel, cl.model_precache, MAX_MODELS); + Team_NewMap (); + Con_NewMap (); + Hunk_Check (); // make sure nothing is hurt + + COM_StripExtension (mapname, name); + strcat (name, ".cfg"); + Cbuf_AddText (cl_cbuf, "exec "); + Cbuf_AddText (cl_cbuf, name); + Cbuf_AddText (cl_cbuf, "\n"); + free (name); +} + void Model_NextDownload (void) { @@ -315,11 +332,7 @@ Model_NextDownload (void) // all done cl.worldmodel = cl.model_precache[1]; - - R_NewMap (cl.worldmodel, cl.model_precache, MAX_MODELS); - Team_NewMap (); - Con_NewMap (); - Hunk_Check (); // make sure nothing is hurt + CL_NewMap (cl.model_name[1]); // done with modellist, request first of static signon messages MSG_WriteByte (&cls.netchan.message, clc_stringcmd);