Skip to content

Commit

Permalink
Fix CSQC garbage collection crash, support GC in CSQC_SIMPLE mode
Browse files Browse the repository at this point in the history
Caused by a "typo" in 3f9fdd4

Closes DarkPlacesEngine/DarkPlaces#161

Signed-off-by: bones_was_here <[email protected]>
  • Loading branch information
bones-was-here committed Apr 6, 2024
1 parent 841b8be commit 0ce2155
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion csprogs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 0ce2155

Please sign in to comment.