Make sure startmap_sp alias is created even if menuqc init crashes out. Also fix another missing Cbuf_AddText \n.

This commit is contained in:
Shpoike 2020-10-17 03:35:32 +01:00
parent afdb605130
commit 43b704a54c

View file

@ -1082,20 +1082,19 @@ void Host_Init (void)
host_initialized = true; host_initialized = true;
Con_Printf ("\n========= Quake Initialized =========\n\n"); Con_Printf ("\n========= Quake Initialized =========\n\n");
if (setjmp (host_abortserver) )
return; // something bad happened
//okay... now we can do stuff that's allowed to Host_Error //okay... now we can do stuff that's allowed to Host_Error
if (setjmp (host_abortserver) )
return; // something bad happened
if (cls.state != ca_dedicated)
M_Init ();
if (setjmp (host_abortserver) )
return; // don't do the above twice if the following Cbuf_Execute does bad things.
//spike -- create these aliases, because they're useful. //spike -- create these aliases, because they're useful.
Cbuf_AddText ("alias startmap_sp \"map start\"\n"); Cbuf_AddText ("alias startmap_sp \"map start\"\n");
Cbuf_AddText ("alias startmap_dm \"map start\"\n"); Cbuf_AddText ("alias startmap_dm \"map start\"\n");
if (cls.state != ca_dedicated)
M_Init ();
if (setjmp (host_abortserver) )
return; // don't do the above twice if the following Cbuf_Execute does bad things.
if (cls.state != ca_dedicated) if (cls.state != ca_dedicated)
{ {
Cbuf_AddText ("cl_warncmd 0\n"); Cbuf_AddText ("cl_warncmd 0\n");
@ -1113,7 +1112,7 @@ void Host_Init (void)
Cbuf_AddText ("cl_warncmd 1\n"); Cbuf_AddText ("cl_warncmd 1\n");
Cbuf_AddText ("exec server.cfg\n"); //spike -- for people who want things explicit. Cbuf_AddText ("exec server.cfg\n"); //spike -- for people who want things explicit.
Cbuf_AddText ("exec autoexec.cfg\n"); Cbuf_AddText ("exec autoexec.cfg\n");
Cbuf_AddText ("stuffcmds"); Cbuf_AddText ("stuffcmds\n");
Cbuf_Execute (); Cbuf_Execute ();
if (!sv.active) if (!sv.active)
Cbuf_AddText ("startmap_dm\n"); Cbuf_AddText ("startmap_dm\n");