CSQC_END
}
}
+void CL_VM_UpdateCoopDeathmatchGlobals (int gametype)
+{
+ // Avoid global names for clean(er) coding
+ int localcoop;
+ int localdeathmatch;
+
+ prvm_eval_t *val;
+ if(cl.csqc_loaded)
+ {
+ if(gametype == GAME_COOP)
+ {
+ localcoop = 1;
+ localdeathmatch = 0;
+ }
+ else
+ if(gametype == GAME_DEATHMATCH)
+ {
+ localcoop = 0;
+ localdeathmatch = 1;
+ }
+ else
+ {
+ // How did the ServerInfo send an unknown gametype?
+ // Better just assign the globals as 0...
+ localcoop = 0;
+ localdeathmatch = 0;
+ }
+ CSQC_BEGIN
+ val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.coop);
+ if(val)
+ val->_float = localcoop;
+ val = PRVM_GLOBALFIELDVALUE(prog->globaloffsets.deathmatch);
+ if(val)
+ val->_float = localdeathmatch;
+ CSQC_END
+ }
+}
float CL_VM_Event (float event) //[515]: needed ? I'd say "YES", but don't know for what :D
{
cl.csqc_vidvars.drawcrosshair = false;
cl.csqc_vidvars.drawenginesbar = false;
+
+ // Update Coop and Deathmatch Globals (at this point the client knows them from ServerInfo)
+ CL_VM_UpdateCoopDeathmatchGlobals(cl.gametype);
}
void CL_VM_ShutDown (void)
int trace_dphittexturename; // ssqc / csqc
int trace_dpstartcontents; // ssqc / csqc
int intermission; // csqc
+ int coop; // csqc
+ int deathmatch; // csqc
}
prvm_prog_globaloffsets_t;
prog->globaloffsets.trace_dphittexturename = PRVM_ED_FindGlobalOffset("trace_dphittexturename");
prog->globaloffsets.trace_dpstartcontents = PRVM_ED_FindGlobalOffset("trace_dpstartcontents");
prog->globaloffsets.intermission = PRVM_ED_FindGlobalOffset("intermission");
+ prog->globaloffsets.coop = PRVM_ED_FindGlobalOffset("coop");
+ prog->globaloffsets.deathmatch = PRVM_ED_FindGlobalOffset("deathmatch");
// menu qc only uses some functions, nothing else
prog->funcoffsets.m_display = PRVM_ED_FindFunctionOffset("m_display");