From 0ce215575a7c3ca108de2d6bb1d76463757d6cc7 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 7 Apr 2024 06:16:17 +1000 Subject: [PATCH] Fix CSQC garbage collection crash, support GC in CSQC_SIMPLE mode Caused by a "typo" in 3f9fdd41aec12c0832ed07f2ba0239383a3801d4 Closes https://github.com/DarkPlacesEngine/darkplaces/issues/161 Signed-off-by: bones_was_here --- csprogs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/csprogs.c b/csprogs.c index 51e324c0..d9d8630a 100644 --- a/csprogs.c +++ b/csprogs.c @@ -540,6 +540,9 @@ void CL_VM_DrawHud(double frametime) PRVM_clientglobaledict(self) = cl.csqc_server2csqcentitynumber[cl.playerentity]; CSQC_SetGlobals(frametime); + PRVM_GarbageCollection(prog); + + // width and height parameters are virtual in CSQC_SIMPLE engines VectorSet(PRVM_G_VECTOR(OFS_PARM0), vid_conwidth.integer, vid_conheight.integer, 0); PRVM_G_FLOAT(OFS_PARM1) = sb_showscores; prog->ExecuteProgram(prog, PRVM_clientfunction(CSQC_DrawHud), "QC function CSQC_DrawHud is missing"); @@ -1118,7 +1121,7 @@ void CL_VM_Init (void) VectorCopy(cl.world.maxs, PRVM_clientedictvector(prog->edicts, absmax)); PRVM_clientedictfloat(prog->edicts, solid) = SOLID_BSP; PRVM_clientedictfloat(prog->edicts, modelindex) = 1; - PRVM_clientedictfloat(prog->edicts, model) = PRVM_SetEngineString(prog, cl.worldmodel->name); + PRVM_clientedictstring(prog->edicts, model) = PRVM_SetEngineString(prog, cl.worldmodel->name); // call the prog init if it exists if (PRVM_clientfunction(CSQC_Init)) -- 2.39.2