if(!cl.csqc_loaded)
return;
CSQC_BEGIN
- PRVM_clientglobalfloat(time) = cl.time;
- PRVM_clientglobaledict(self) = 0;
- if (PRVM_clientfunction(CSQC_Shutdown))
- prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_Shutdown), "QC function CSQC_Shutdown is missing");
+ if (prog->loaded)
+ {
+ PRVM_clientglobalfloat(time) = cl.time;
+ PRVM_clientglobaledict(self) = 0;
+ if (PRVM_clientfunction(CSQC_Shutdown))
+ prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_Shutdown), "QC function CSQC_Shutdown is missing");
+ }
PRVM_Prog_Reset(prog);
CSQC_END
Con_DPrint("CSQC ^1unloaded\n");
static void MP_Shutdown (void)
{
prvm_prog_t *prog = MVM_prog;
-
- prog->ExecuteProgram(prog, PRVM_menufunction(m_shutdown),"m_shutdown() required");
+ if (prog->loaded)
+ prog->ExecuteProgram(prog, PRVM_menufunction(m_shutdown),"m_shutdown() required");
// reset key_dest
key_dest = key_game;
void SVVM_reset_cmd(prvm_prog_t *prog)
{
World_End(&sv.world);
- if(PRVM_serverfunction(SV_Shutdown))
+
+ if(prog->loaded && PRVM_serverfunction(SV_Shutdown))
{
func_t s = PRVM_serverfunction(SV_Shutdown);
PRVM_serverglobalfloat(time) = sv.time;