From 8a7609f3fee17715718c5733114e00278c3d5a2a Mon Sep 17 00:00:00 2001 From: Shpoike Date: Sun, 27 Jan 2019 16:50:19 +0000 Subject: [PATCH] Fix r_showbboxes bug (reported by c0burn) --- Quake/gl_rmain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Quake/gl_rmain.c b/Quake/gl_rmain.c index 64f3080f..15d8fccc 100644 --- a/Quake/gl_rmain.c +++ b/Quake/gl_rmain.c @@ -742,6 +742,7 @@ void R_ShowBoundingBoxes (void) vec3_t mins,maxs; edict_t *ed; int i; + qcvm_t *oldvm; //in case we ever draw a scene from within csqc. if (!r_showbboxes.value || cl.maxclients > 1 || !r_drawentities.value || !sv.active) return; @@ -753,6 +754,8 @@ void R_ShowBoundingBoxes (void) glDisable (GL_CULL_FACE); glColor3f (1,1,1); + oldvm = qcvm; + PR_SwitchQCVM(&sv.qcvm); for (i=0, ed=NEXT_EDICT(qcvm->edicts) ; inum_edicts ; i++, ed=NEXT_EDICT(ed)) { if (ed == sv_player) @@ -775,6 +778,7 @@ void R_ShowBoundingBoxes (void) R_EmitWireBox (mins, maxs); } } + PR_SwitchQCVM(oldvm); glColor3f (1,1,1); glEnable (GL_TEXTURE_2D);