From f166000a04d792ba92af63f11f32cdc28656f0b3 Mon Sep 17 00:00:00 2001 From: Spike Date: Thu, 28 Jun 2018 05:42:28 +0100 Subject: [PATCH] Avoid csqc crashes from setorigin etc. Also avoid issues from csqc errors while scissor is enabled. --- Quake/host.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Quake/host.c b/Quake/host.c index e38a5c58..cd4e3507 100644 --- a/Quake/host.c +++ b/Quake/host.c @@ -171,6 +171,8 @@ void Host_Error (const char *error, ...) Sys_Error ("Host_Error: recursively entered"); inerror = true; + if (cl.qcvm.progs) + glDisable(GL_SCISSOR_TEST); //equivelent to drawresetcliparea, to reset any damage if we crashed in csqc. PR_SwitchQCVM(NULL); SCR_EndLoadingPlaque (); // reenable screen updates @@ -776,6 +778,8 @@ void _Host_Frame (double time) *qcvm->extglobals.player_localnum = cl.viewentity; //this is a guess, but is important for scoreboards. //and call the init function... if it exists. + qcvm->worldmodel = cl.worldmodel; + SV_ClearWorld(); if (qcvm->extfuncs.CSQC_Init) { G_FLOAT(OFS_PARM0) = 0;