From: havoc Date: Mon, 9 May 2011 20:20:37 +0000 (+0000) Subject: added prvm_offsets.h which centralizes field/global/function lookups for X-Git-Tag: xonotic-v0.6.0~163^2~401 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c6898ab1f01b8efd78fea454b3f8654c4265ebb;p=xonotic%2Fdarkplaces.git added prvm_offsets.h which centralizes field/global/function lookups for easier maintenance, this file is included with a huge set of macros for each different purpose... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11145 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_gecko.c b/cl_gecko.c index d92ed0a4..e66482d6 100644 --- a/cl_gecko.c +++ b/cl_gecko.c @@ -525,14 +525,14 @@ static OSGK_ScriptResult dpGlobal_query (void* objTag, void* methTag, saveProg = prog; PRVM_SetProg(instance->ownerProg); - if (prog->funcoffsets.Gecko_Query) + if (PRVM_clientfunction(Gecko_Query)) { OSGK_String* paramStr, *resultStr; if (!osgk_variant_get_string (strVal, ¶mStr)) return srFailed; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString (instance->name); PRVM_G_INT(OFS_PARM1) = PRVM_SetTempString (osgk_string_get (paramStr)); - PRVM_ExecuteProgram(prog->funcoffsets.Gecko_Query,"Gecko_Query() required"); + PRVM_ExecuteProgram(PRVM_clientfunction(Gecko_Query),"Gecko_Query() required"); resultStr = osgk_string_create (PRVM_G_STRING (OFS_RETURN)); *returnVal = osgk_variant_create_string (cl_geckoembedding, resultStr); osgk_release (resultStr); diff --git a/clvm_cmds.c b/clvm_cmds.c index ea5ea170..937c21b7 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -756,7 +756,7 @@ void VM_CL_R_AddEntities (void) } // callprofile fixing hack: do not include this time in what is counted for CSQC_UpdateView - prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t; + prog->functions[PRVM_clientfunction(CSQC_UpdateView)].totaltime -= Sys_DoubleTime() - t; } //#302 void(entity ent) addentity (EXT_CSQC) @@ -765,7 +765,7 @@ void VM_CL_R_AddEntity (void) double t = Sys_DoubleTime(); VM_SAFEPARMCOUNT(1, VM_CL_R_AddEntity); CSQC_AddRenderEdict(PRVM_G_EDICT(OFS_PARM0), 0); - prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t; + prog->functions[PRVM_clientfunction(CSQC_UpdateView)].totaltime -= Sys_DoubleTime() - t; } //#303 float(float property, ...) setproperty (EXT_CSQC) @@ -1041,7 +1041,7 @@ void VM_CL_R_AddDynamicLight (void) R_RTLight_Update(&r_refdef.scene.templights[r_refdef.scene.numlights], false, &matrix, col, style, cubemapname, castshadow, coronaintensity, coronasizescale, ambientscale, diffusescale, specularscale, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE); r_refdef.scene.lights[r_refdef.scene.numlights] = &r_refdef.scene.templights[r_refdef.scene.numlights];r_refdef.scene.numlights++; - prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t; + prog->functions[PRVM_clientfunction(CSQC_UpdateView)].totaltime -= Sys_DoubleTime() - t; } //============================================================================ @@ -3006,7 +3006,7 @@ void VM_CL_R_RenderScene (void) polys->progstarttime = prog->starttime; // callprofile fixing hack: do not include this time in what is counted for CSQC_UpdateView - prog->functions[prog->funcoffsets.CSQC_UpdateView].totaltime -= Sys_DoubleTime() - t; + prog->functions[PRVM_clientfunction(CSQC_UpdateView)].totaltime -= Sys_DoubleTime() - t; } static void VM_ResizePolygons(vmpolygons_t *polys) diff --git a/csprogs.c b/csprogs.c index 7dd08c49..58290c5b 100644 --- a/csprogs.c +++ b/csprogs.c @@ -42,140 +42,158 @@ static int cl_numrequiredfunc = sizeof(cl_required_func) / sizeof(char*); prvm_required_field_t cl_reqfields[] = { - {ev_entity, "aiment"}, // client field - {ev_entity, "enemy"}, // client field - {ev_entity, "groundentity"}, // client field - {ev_entity, "tag_entity"}, // client field - {ev_float, "alpha"}, // client field - {ev_float, "bouncefactor"}, // client field - {ev_float, "bouncestop"}, // client field - {ev_float, "dphitcontentsmask"}, // client field - {ev_float, "frame1time"}, // client field - {ev_float, "frame2time"}, // client field - {ev_float, "frame2"}, // client field - {ev_float, "frame3time"}, // client field - {ev_float, "frame3"}, // client field - {ev_float, "frame4time"}, // client field - {ev_float, "frame4"}, // client field - {ev_float, "frame"}, // client field - {ev_float, "gravity"}, // client field - {ev_float, "gravity"}, // client field - {ev_float, "ideal_yaw"}, // client field - {ev_float, "idealpitch"}, // client field - {ev_float, "jointtype"}, // client field - {ev_float, "lerpfrac3"}, // client field - {ev_float, "lerpfrac4"}, // client field - {ev_float, "lerpfrac"}, // client field - {ev_float, "mass"}, // client field - {ev_float, "modelindex"}, // client field - {ev_float, "movetype"}, // client field - {ev_float, "pitch_speed"}, // client field - {ev_float, "renderflags"}, // client field - {ev_float, "scale"}, // client field - {ev_float, "scale"}, // client field - {ev_float, "shadertime"}, // client field - {ev_float, "skeletonindex"}, // client field - {ev_float, "solid"}, // client field - {ev_float, "tag_index"}, // client field - {ev_float, "userwavefunc_param0"}, // client field - {ev_float, "userwavefunc_param1"}, // client field - {ev_float, "userwavefunc_param2"}, // client field - {ev_float, "userwavefunc_param3"}, // client field - {ev_float, "yaw_speed"}, // client field - {ev_function, "camera_transform"}, // client field - {ev_string, "classname"}, // client field - {ev_string, "message"}, // client field - {ev_vector, "angles"}, // client field - {ev_vector, "avelocity"}, // client field - {ev_vector, "colormod"}, // client field - {ev_vector, "glowmod"}, // client field - {ev_vector, "maxs"}, // client field - {ev_vector, "mins"}, // client field - {ev_vector, "movedir"}, // client field - {ev_vector, "origin"}, // client field - {ev_vector, "velocity"}, // client field +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) {ev_float, #x }, +#define PRVM_DECLARE_clientfieldvector(x) {ev_vector, #x }, +#define PRVM_DECLARE_clientfieldstring(x) {ev_string, #x }, +#define PRVM_DECLARE_clientfieldedict(x) {ev_entity, #x }, +#define PRVM_DECLARE_clientfieldfunction(x) {ev_function, #x }, +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; #define CL_REQGLOBALS (sizeof(cl_reqglobals) / sizeof(prvm_required_field_t)) prvm_required_field_t cl_reqglobals[] = { - {ev_entity, "self"}, // client global - {ev_entity, "trace_ent"}, // client global - {ev_float, "coop"}, // client global - {ev_float, "deathmatch"}, // client global - {ev_float, "dmg_save"}, // client global - {ev_float, "dmg_take"}, // client global - {ev_float, "drawfont"}, // client global - {ev_float, "gettaginfo_parent"}, // client global - {ev_float, "intermission"}, // client global - {ev_float, "particle_airfriction"}, // client global - {ev_float, "particle_alpha"}, // client global - {ev_float, "particle_alphafade"}, // client global - {ev_float, "particle_angle"}, // client global - {ev_float, "particle_blendmode"}, // client global - {ev_float, "particle_bounce"}, // client global - {ev_float, "particle_delaycollision"}, // client global - {ev_float, "particle_delayspawn"}, // client global - {ev_float, "particle_gravity"}, // client global - {ev_float, "particle_liquidfriction"}, // client global - {ev_float, "particle_orientation"}, // client global - {ev_float, "particle_originjitter"}, // client global - {ev_float, "particle_qualityreduction"}, // client global - {ev_float, "particle_size"}, // client global - {ev_float, "particle_sizeincrease"}, // client global - {ev_float, "particle_spin"}, // client global - {ev_float, "particle_stainalpha"}, // client global - {ev_float, "particle_stainsize"}, // client global - {ev_float, "particle_staintex"}, // client global - {ev_float, "particle_staintex"}, // client global - {ev_float, "particle_stretch"}, // client global - {ev_float, "particle_tex"}, // client global - {ev_float, "particle_time"}, // client global - {ev_float, "particle_type"}, // client global - {ev_float, "particle_velocityjitter"}, // client global - {ev_float, "particles_alphamax"}, // client global - {ev_float, "particles_alphamin"}, // client global - {ev_float, "require_spawnfunc_prefix"}, // client global - {ev_float, "sb_showscores"}, // client global - {ev_float, "serverdeltatime"}, // client global - {ev_float, "serverprevtime"}, // client global - {ev_float, "servertime"}, // client global - {ev_float, "trace_allsolid"}, // client global - {ev_float, "trace_dphitcontents"}, // client global - {ev_float, "trace_dphitq3surfaceflags"}, // client global - {ev_float, "trace_dpstartcontents"}, // client global - {ev_float, "trace_fraction"}, // client global - {ev_float, "trace_inopen"}, // client global - {ev_float, "trace_inwater"}, // client global - {ev_float, "trace_networkentity"}, // client global - {ev_float, "trace_plane_dist"}, // client global - {ev_float, "trace_startsolid"}, // client global - {ev_float, "transparent_offset"}, // client global - {ev_string, "gettaginfo_name"}, // client global - {ev_string, "trace_dphittexturename"}, // client global - {ev_vector, "dmg_origin"}, // client global - {ev_vector, "drawfontscale"}, // client global - {ev_vector, "gettaginfo_forward"}, // client global - {ev_vector, "gettaginfo_offset"}, // client global - {ev_vector, "gettaginfo_right"}, // client global - {ev_vector, "gettaginfo_up"}, // client global - {ev_vector, "particle_color1"}, // client global - {ev_vector, "particle_color2"}, // client global - {ev_vector, "particle_staincolor1"}, // client global - {ev_vector, "particle_staincolor2"}, // client global - {ev_vector, "particles_colormax"}, // client global - {ev_vector, "particles_colormin"}, // client global - {ev_vector, "pmove_inwater"}, // client global - {ev_vector, "pmove_onground"}, // client global - {ev_vector, "trace_endpos"}, // client global - {ev_vector, "trace_plane_normal"}, // client global - {ev_vector, "v_forward"}, // client global - {ev_vector, "v_right"}, // client global - {ev_vector, "v_up"}, // client global - {ev_vector, "view_angles"}, // client global - {ev_vector, "view_punchangle"}, // client global - {ev_vector, "view_punchvector"}, // client global +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) {ev_float, #x}, +#define PRVM_DECLARE_clientglobalvector(x) {ev_vector, #x}, +#define PRVM_DECLARE_clientglobalstring(x) {ev_string, #x}, +#define PRVM_DECLARE_clientglobaledict(x) {ev_entity, #x}, +#define PRVM_DECLARE_clientglobalfunction(x) {ev_function, #x}, +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; void CL_VM_Error (const char *format, ...) DP_FUNC_PRINTF(1); @@ -413,7 +431,7 @@ qboolean CL_VM_InputEvent (qboolean down, int key, int ascii) return false; CSQC_BEGIN - if (!prog->funcoffsets.CSQC_InputEvent) + if (!PRVM_clientfunction(CSQC_InputEvent)) r = false; else { @@ -422,7 +440,7 @@ qboolean CL_VM_InputEvent (qboolean down, int key, int ascii) PRVM_G_FLOAT(OFS_PARM0) = !down; // 0 is down, 1 is up PRVM_G_FLOAT(OFS_PARM1) = key; PRVM_G_FLOAT(OFS_PARM2) = ascii; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_InputEvent, "QC function CSQC_InputEvent is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_InputEvent), "QC function CSQC_InputEvent is missing"); r = CSQC_RETURNVAL != 0; } CSQC_END @@ -451,7 +469,7 @@ qboolean CL_VM_UpdateView (void) // pass in width and height as parameters (EXT_CSQC_1) PRVM_G_FLOAT(OFS_PARM0) = vid.width; PRVM_G_FLOAT(OFS_PARM1) = vid.height; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_UpdateView, "QC function CSQC_UpdateView is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_UpdateView), "QC function CSQC_UpdateView is missing"); //VectorCopy(oldangles, cl.viewangles); // Dresk : Reset Dmg Globals Here CL_VM_UpdateDmgGlobals(0, 0, emptyvector); @@ -468,13 +486,13 @@ qboolean CL_VM_ConsoleCommand (const char *cmd) if(!cl.csqc_loaded) return false; CSQC_BEGIN - if (prog->funcoffsets.CSQC_ConsoleCommand) + if (PRVM_clientfunction(CSQC_ConsoleCommand)) { prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(cmd); - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_ConsoleCommand, "QC function CSQC_ConsoleCommand is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_ConsoleCommand), "QC function CSQC_ConsoleCommand is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; r = CSQC_RETURNVAL != 0; } @@ -489,12 +507,12 @@ qboolean CL_VM_Parse_TempEntity (void) if(!cl.csqc_loaded) return false; CSQC_BEGIN - if(prog->funcoffsets.CSQC_Parse_TempEntity) + if(PRVM_clientfunction(CSQC_Parse_TempEntity)) { t = msg_readcount; prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Parse_TempEntity, "QC function CSQC_Parse_TempEntity is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_TempEntity), "QC function CSQC_Parse_TempEntity is missing"); r = CSQC_RETURNVAL != 0; if(!r) { @@ -572,13 +590,13 @@ void CL_VM_Parse_StuffCmd (const char *msg) return; } CSQC_BEGIN - if(prog->funcoffsets.CSQC_Parse_StuffCmd) + if(PRVM_clientfunction(CSQC_Parse_StuffCmd)) { prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg); - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Parse_StuffCmd, "QC function CSQC_Parse_StuffCmd is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_StuffCmd), "QC function CSQC_Parse_StuffCmd is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; } else @@ -593,7 +611,7 @@ static void CL_VM_Parse_Print (const char *msg) prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg); - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Parse_Print, "QC function CSQC_Parse_Print is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_Print), "QC function CSQC_Parse_Print is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; } @@ -606,7 +624,7 @@ void CSQC_AddPrintText (const char *msg) return; } CSQC_BEGIN - if(prog->funcoffsets.CSQC_Parse_Print) + if(PRVM_clientfunction(CSQC_Parse_Print)) { // FIXME: is this bugged? i = strlen(msg)-1; @@ -639,13 +657,13 @@ void CL_VM_Parse_CenterPrint (const char *msg) return; } CSQC_BEGIN - if(prog->funcoffsets.CSQC_Parse_CenterPrint) + if(PRVM_clientfunction(CSQC_Parse_CenterPrint)) { prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(msg); - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Parse_CenterPrint, "QC function CSQC_Parse_CenterPrint is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Parse_CenterPrint), "QC function CSQC_Parse_CenterPrint is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; } else @@ -677,7 +695,7 @@ qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float atten if(cl.csqc_loaded) { CSQC_BEGIN - if(prog->funcoffsets.CSQC_Event_Sound) + if(PRVM_clientfunction(CSQC_Event_Sound)) { prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; @@ -687,7 +705,7 @@ qboolean CL_VM_Event_Sound(int sound_num, float volume, int channel, float atten PRVM_G_FLOAT(OFS_PARM3) = volume; PRVM_G_FLOAT(OFS_PARM4) = attenuation; VectorCopy(pos, PRVM_G_VECTOR(OFS_PARM5) ); - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Event_Sound, "QC function CSQC_Event_Sound is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event_Sound), "QC function CSQC_Event_Sound is missing"); r = CSQC_RETURNVAL != 0; } CSQC_END @@ -733,12 +751,12 @@ float CL_VM_Event (float event) //[515]: needed ? I'd say "YES", but don't know if(!cl.csqc_loaded) return 0; CSQC_BEGIN - if(prog->funcoffsets.CSQC_Event) + if(PRVM_clientfunction(CSQC_Event)) { prog->globals.client->time = cl.time; prog->globals.client->self = cl.csqc_server2csqcentitynumber[cl.playerentity]; PRVM_G_FLOAT(OFS_PARM0) = event; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Event, "QC function CSQC_Event is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Event), "QC function CSQC_Event is missing"); r = CSQC_RETURNVAL; } CSQC_END @@ -768,7 +786,7 @@ void CSQC_ReadEntities (void) { if(prog->globals.client->self) { - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Ent_Remove, "QC function CSQC_Ent_Remove is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Remove), "QC function CSQC_Ent_Remove is missing"); cl.csqc_server2csqcentitynumber[realentnum] = 0; } else @@ -784,7 +802,7 @@ void CSQC_ReadEntities (void) { if(!prog->globals.client->self) { - if(!prog->funcoffsets.CSQC_Ent_Spawn) + if(!PRVM_clientfunction(CSQC_Ent_Spawn)) { prvm_edict_t *ed; ed = PRVM_ED_Alloc(); @@ -798,15 +816,15 @@ void CSQC_ReadEntities (void) PRVM_G_FLOAT(OFS_PARM0) = (float) realentnum; // make sure no one gets wrong ideas prog->globals.client->self = 0; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Ent_Spawn, "QC function CSQC_Ent_Spawn is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Spawn), "QC function CSQC_Ent_Spawn is missing"); prog->globals.client->self = cl.csqc_server2csqcentitynumber[realentnum] = PRVM_EDICT( PRVM_G_INT( OFS_RETURN ) ); } PRVM_G_FLOAT(OFS_PARM0) = 1; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Ent_Update, "QC function CSQC_Ent_Update is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Update), "QC function CSQC_Ent_Update is missing"); } else { PRVM_G_FLOAT(OFS_PARM0) = 0; - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Ent_Update, "QC function CSQC_Ent_Update is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Ent_Update), "QC function CSQC_Ent_Update is missing"); } } } @@ -1072,7 +1090,7 @@ void CL_VM_Init (void) VectorCopy(cl.world.maxs, prog->edicts->fields.client->maxs); // call the prog init - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Init, "QC function CSQC_Init is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Init), "QC function CSQC_Init is missing"); PRVM_End; cl.csqc_loaded = true; @@ -1094,8 +1112,8 @@ void CL_VM_ShutDown (void) CSQC_BEGIN prog->globals.client->time = cl.time; prog->globals.client->self = 0; - if (prog->funcoffsets.CSQC_Shutdown) - PRVM_ExecuteProgram(prog->funcoffsets.CSQC_Shutdown, "QC function CSQC_Shutdown is missing"); + if (PRVM_clientfunction(CSQC_Shutdown)) + PRVM_ExecuteProgram(PRVM_clientfunction(CSQC_Shutdown), "QC function CSQC_Shutdown is missing"); PRVM_ResetProg(); CSQC_END Con_DPrint("CSQC ^1unloaded\n"); diff --git a/host.c b/host.c index 812c2146..d8909c14 100644 --- a/host.c +++ b/host.c @@ -567,10 +567,10 @@ void Host_ShutdownServer(void) SV_VM_Begin(); World_End(&sv.world); if(prog->loaded) - if(prog->funcoffsets.SV_Shutdown) + if(PRVM_serverfunction(SV_Shutdown)) { - func_t s = prog->funcoffsets.SV_Shutdown; - prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again + func_t s = PRVM_serverfunction(SV_Shutdown); + PRVM_serverfunction(SV_Shutdown) = 0; // prevent it from getting called again PRVM_ExecuteProgram(s,"SV_Shutdown() required"); } for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++) @@ -861,7 +861,7 @@ void Host_Main(void) if (sv.paused == 1 && realtime > sv.pausedstart && sv.pausedstart > 0) { prog->globals.generic[OFS_PARM0] = realtime - sv.pausedstart; - PRVM_ExecuteProgram(prog->funcoffsets.SV_PausedTic, "QC function SV_PausedTic is missing"); + PRVM_ExecuteProgram(PRVM_serverfunction(SV_PausedTic), "QC function SV_PausedTic is missing"); } // end the server VM frame diff --git a/host_cmd.c b/host_cmd.c index 9278b7aa..1f12018f 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -1572,13 +1572,13 @@ void Host_Color(int changetop, int changebottom) if (cls.protocol == PROTOCOL_QUAKEWORLD) return; - if (host_client->edict && prog->funcoffsets.SV_ChangeTeam) + if (host_client->edict && PRVM_clientfunction(SV_ChangeTeam)) { Con_DPrint("Calling SV_ChangeTeam\n"); prog->globals.server->time = sv.time; prog->globals.generic[OFS_PARM0] = playercolor; prog->globals.server->self = PRVM_EDICT_TO_PROG(host_client->edict); - PRVM_ExecuteProgram(prog->funcoffsets.SV_ChangeTeam, "QC function SV_ChangeTeam is missing"); + PRVM_ExecuteProgram(PRVM_clientfunction(SV_ChangeTeam), "QC function SV_ChangeTeam is missing"); } else { @@ -1795,12 +1795,12 @@ void Host_Spawn_f (void) if (sv.loadgame) { // loaded games are fully initialized already - if (prog->funcoffsets.RestoreGame) + if (PRVM_serverfunction(RestoreGame)) { Con_DPrint("Calling RestoreGame\n"); prog->globals.server->time = sv.time; prog->globals.server->self = PRVM_EDICT_TO_PROG(host_client->edict); - PRVM_ExecuteProgram(prog->funcoffsets.RestoreGame, "QC function RestoreGame is missing"); + PRVM_ExecuteProgram(PRVM_serverfunction(RestoreGame), "QC function RestoreGame is missing"); } } else @@ -2378,7 +2378,7 @@ void Host_SendCvar_f (void) Cmd_ForwardStringToServer(va("sentcvar %s \"%s\"", c->name, c->string)); return; } - if(!sv.active)// || !prog->funcoffsets.SV_ParseClientCommand) + if(!sv.active)// || !PRVM_serverfunction(SV_ParseClientCommand)) return; old = host_client; diff --git a/menu.c b/menu.c index 5d726dfc..f0ef7c01 100644 --- a/menu.c +++ b/menu.c @@ -5017,17 +5017,158 @@ static int m_numrequiredfunc = sizeof(m_required_func) / sizeof(char*); static prvm_required_field_t m_required_fields[] = { - {ev_string, "classname"}, // menu field +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) {ev_float, #x}, +#define PRVM_DECLARE_menufieldvector(x) {ev_vector, #x}, +#define PRVM_DECLARE_menufieldstring(x) {ev_string, #x}, +#define PRVM_DECLARE_menufieldedict(x) {ev_entity, #x}, +#define PRVM_DECLARE_menufieldfunction(x) {ev_function, #x}, +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; static int m_numrequiredfields = sizeof(m_required_fields) / sizeof(m_required_fields[0]); static prvm_required_field_t m_required_globals[] = { - {ev_entity, "self"}, // menu global - {ev_float, "drawfont"}, // menu global - {ev_float, "require_spawnfunc_prefix"}, // menu global - {ev_vector, "drawfontscale"}, // menu global +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) {ev_float, #x}, +#define PRVM_DECLARE_menuglobalvector(x) {ev_vector, #x}, +#define PRVM_DECLARE_menuglobalstring(x) {ev_string, #x}, +#define PRVM_DECLARE_menuglobaledict(x) {ev_entity, #x}, +#define PRVM_DECLARE_menuglobalfunction(x) {ev_function, #x}, +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; static int m_numrequiredglobals = sizeof(m_required_globals) / sizeof(m_required_globals[0]); @@ -5079,9 +5220,9 @@ void MP_KeyEvent (int key, int ascii, qboolean downevent) prog->globals.generic[OFS_PARM0] = (float) key; prog->globals.generic[OFS_PARM1] = (float) ascii; if (downevent) - PRVM_ExecuteProgram(prog->funcoffsets.m_keydown,"m_keydown(float key, float ascii) required"); - else if (prog->funcoffsets.m_keyup) - PRVM_ExecuteProgram(prog->funcoffsets.m_keyup,"m_keyup(float key, float ascii) required"); + PRVM_ExecuteProgram(PRVM_menufunction(m_keydown),"m_keydown(float key, float ascii) required"); + else if (PRVM_menufunction(m_keyup)) + PRVM_ExecuteProgram(PRVM_menufunction(m_keyup),"m_keyup(float key, float ascii) required"); PRVM_End; } @@ -5108,7 +5249,7 @@ void MP_Draw (void) // FIXME: this really shouldnt error out lest we have a very broken refdef state...? // or does it kill the server too? - PRVM_ExecuteProgram(prog->funcoffsets.m_draw,"m_draw() required"); + PRVM_ExecuteProgram(PRVM_menufunction(m_draw),"m_draw() required"); PRVM_End; @@ -5124,7 +5265,7 @@ void MP_ToggleMenu(int mode) PRVM_SetProg(PRVM_MENUPROG); prog->globals.generic[OFS_PARM0] = (float) mode; - PRVM_ExecuteProgram(prog->funcoffsets.m_toggle,"m_toggle() required"); + PRVM_ExecuteProgram(PRVM_menufunction(m_toggle),"m_toggle() required"); PRVM_End; } @@ -5133,8 +5274,8 @@ void MP_NewMap(void) { PRVM_Begin; PRVM_SetProg(PRVM_MENUPROG); - if (prog->funcoffsets.m_newmap) - PRVM_ExecuteProgram(prog->funcoffsets.m_newmap,"m_newmap() required"); + if (PRVM_menufunction(m_newmap)) + PRVM_ExecuteProgram(PRVM_menufunction(m_newmap),"m_newmap() required"); PRVM_End; } @@ -5143,7 +5284,7 @@ void MP_Shutdown (void) PRVM_Begin; PRVM_SetProg(PRVM_MENUPROG); - PRVM_ExecuteProgram(prog->funcoffsets.m_shutdown,"m_shutdown() required"); + PRVM_ExecuteProgram(PRVM_menufunction(m_shutdown),"m_shutdown() required"); // reset key_dest key_dest = key_game; @@ -5183,7 +5324,7 @@ void MP_Init (void) in_client_mouse = true; // call the prog init - PRVM_ExecuteProgram(prog->funcoffsets.m_init,"m_init() required"); + PRVM_ExecuteProgram(PRVM_menufunction(m_init),"m_init() required"); PRVM_End; } diff --git a/progsvm.h b/progsvm.h index de85a66d..9794111c 100644 --- a/progsvm.h +++ b/progsvm.h @@ -127,6 +127,7 @@ extern prvm_eval_t prvm_badvalue; #define PRVM_allglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) #define PRVM_allglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) #define PRVM_allglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) +#define PRVM_allfunction(funcname) (prog->funcoffsets.funcname) #define PRVM_drawedictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) #define PRVM_drawedictvector(ed, fieldname) (PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname)) @@ -138,6 +139,7 @@ extern prvm_eval_t prvm_badvalue; #define PRVM_drawglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) #define PRVM_drawglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) #define PRVM_drawglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) +#define PRVM_drawfunction(funcname) (prog->funcoffsets.funcname) #define PRVM_gameedictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) #define PRVM_gameedictvector(ed, fieldname) (PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname)) @@ -149,6 +151,7 @@ extern prvm_eval_t prvm_badvalue; #define PRVM_gameglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) #define PRVM_gameglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) #define PRVM_gameglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) +#define PRVM_gamefunction(funcname) (prog->funcoffsets.funcname) #define PRVM_serveredictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) #define PRVM_serveredictvector(ed, fieldname) (PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname)) @@ -160,6 +163,7 @@ extern prvm_eval_t prvm_badvalue; #define PRVM_serverglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) #define PRVM_serverglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) #define PRVM_serverglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) +#define PRVM_serverfunction(funcname) (prog->funcoffsets.funcname) #define PRVM_clientedictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) #define PRVM_clientedictvector(ed, fieldname) (PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname)) @@ -171,7 +175,19 @@ extern prvm_eval_t prvm_badvalue; #define PRVM_clientglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) #define PRVM_clientglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) #define PRVM_clientglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) - +#define PRVM_clientfunction(funcname) (prog->funcoffsets.funcname) + +#define PRVM_menuedictfloat(ed, fieldname) (PRVM_EDICTFIELDFLOAT(ed, prog->fieldoffsets.fieldname)) +#define PRVM_menuedictvector(ed, fieldname) (PRVM_EDICTFIELDVECTOR(ed, prog->fieldoffsets.fieldname)) +#define PRVM_menuedictstring(ed, fieldname) (PRVM_EDICTFIELDSTRING(ed, prog->fieldoffsets.fieldname)) +#define PRVM_menuedictedict(ed, fieldname) (PRVM_EDICTFIELDEDICT(ed, prog->fieldoffsets.fieldname)) +#define PRVM_menuedictfunction(ed, fieldname) (PRVM_EDICTFIELDFUNCTION(ed, prog->fieldoffsets.fieldname)) +#define PRVM_menuglobalfloat(fieldname) (PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.fieldname)) +#define PRVM_menuglobalvector(fieldname) (PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.fieldname)) +#define PRVM_menuglobalstring(fieldname) (PRVM_GLOBALFIELDSTRING(prog->globaloffsets.fieldname)) +#define PRVM_menuglobaledict(fieldname) (PRVM_GLOBALFIELDEDICT(prog->globaloffsets.fieldname)) +#define PRVM_menuglobalfunction(fieldname) (PRVM_GLOBALFIELDFUNCTION(prog->globaloffsets.fieldname)) +#define PRVM_menufunction(funcname) (prog->funcoffsets.funcname) #if 1 #define PRVM_EDICTFIELDVALUE(ed, fieldoffset) (fieldoffset < 0 ? Con_Printf("Invalid fieldoffset at %s:%i\n", __FILE__, __LINE__), &prvm_badvalue : (prvm_eval_t *)((int *)ed->fields.vp + fieldoffset)) @@ -225,275 +241,237 @@ typedef void (*prvm_builtin_t) (void); // NOTE: field offsets use -1 for NULL typedef struct prvm_prog_fieldoffsets_s { - // server and client use a lot of similar fields, so this is combined - int SendEntity; // ssqc - int SendFlags; // ssqc - int Version; // ssqc (legacy) - int alpha; // ssqc / csqc - int ammo_cells1; // ssqc - Dissolution of Eternity mission pack - int ammo_lava_nails; // ssqc - Dissolution of Eternity mission pack - int ammo_multi_rockets; // ssqc - Dissolution of Eternity mission pack - int ammo_nails1; // ssqc - Dissolution of Eternity mission pack - int ammo_plasma; // ssqc - Dissolution of Eternity mission pack - int ammo_rockets1; // ssqc - Dissolution of Eternity mission pack - int ammo_shells1; // ssqc - Dissolution of Eternity mission pack - int angles; // common - used by changeyaw/changepitch - int button3; // ssqc - int button4; // ssqc - int button5; // ssqc - int button6; // ssqc - int button7; // ssqc - int button8; // ssqc - int button9; // ssqc - int button10; // ssqc - int button11; // ssqc - int button12; // ssqc - int button13; // ssqc - int button14; // ssqc - int button15; // ssqc - int button16; // ssqc - int buttonchat; // ssqc - int buttonuse; // ssqc - int chain; // common - used by find builtins - int classname; // common - int clientcamera; // ssqc - int clientcolors; // ssqc - int clientstatus; // ssqc - int color; // ssqc - int colormod; // ssqc / csqc - int contentstransition; // ssqc - int cursor_active; // ssqc - int cursor_screen; // ssqc - int cursor_trace_endpos; // ssqc - int cursor_trace_ent; // ssqc - int cursor_trace_start; // ssqc - int customizeentityforclient; // ssqc - int dimension_hit; // ssqc / csqc - int dimension_solid; // ssqc / csqc - int disableclientprediction; // ssqc - int discardabledemo; // ssqc - int dphitcontentsmask; // ssqc / csqc - int drawonlytoclient; // ssqc - int exteriormodeltoclient; // ssqc - int fatness; // ssqc / csqc - int forceshader; // csqc - int frame1time; // csqc - int frame2; // csqc - int frame2time; // csqc - int frame3; // csqc - int frame3time; // csqc - int frame4; // csqc - int frame4time; // csqc - int frame; // common - used by OP_STATE - int fullbright; // ssqc - Nehahra support - int glow_color; // ssqc - int glow_size; // ssqc - int glow_trail; // ssqc - int glowmod; // ssqc / csqc - int gravity; // ssqc - int groundentity; // ssqc / csqc - int hull; // ssqc / csqc - int ideal_yaw; // ssqc / csqc - int idealpitch; // ssqc / csqc - int items2; // ssqc - int lerpfrac3; // csqc - int lerpfrac4; // csqc - int lerpfrac; // csqc - int light_lev; // ssqc - int message; // csqc - int modelflags; // ssqc - int movement; // ssqc - int movetypesteplandevent; // ssqc - int netaddress; // ssqc - int nextthink; // common - used by OP_STATE - int nodrawtoclient; // ssqc - int pflags; // ssqc - int ping; // ssqc - int ping_packetloss; // ssqc - int ping_movementloss; // ssqc - int pitch_speed; // ssqc / csqc - int playermodel; // ssqc - int playerskin; // ssqc - int pmodel; // ssqc - int punchvector; // ssqc - int renderamt; // ssqc - HalfLife support - int renderflags; // csqc - int rendermode; // ssqc - HalfLife support - int scale; // ssqc / csqc - int shadertime; // csqc - int skeletonindex; // csqc / ssqc FTE_CSQC_SKELETONOBJECTS / DP_SKELETONOBJECTS - int style; // ssqc - int tag_entity; // ssqc / csqc - int tag_index; // ssqc / csqc - int think; // common - used by OP_STATE - int viewmodelforclient; // ssqc - int viewzoom; // ssqc - int yaw_speed; // ssqc / csqc - int bouncefactor; // ssqc - int bouncestop; // ssqc - int sendcomplexanimation; // ssqc - - int solid; // ssqc / csqc (physics) - int movetype; // ssqc / csqc (physics) - int modelindex; // ssqc / csqc (physics) - int mins; // ssqc / csqc (physics) - int maxs; // ssqc / csqc (physics) - int mass; // ssqc / csqc (physics) - int origin; // ssqc / csqc (physics) - int velocity; // ssqc / csqc (physics) - //int axis_forward; // ssqc / csqc (physics) - //int axis_left; // ssqc / csqc (physics) - //int axis_up; // ssqc / csqc (physics) - //int spinvelocity; // ssqc / csqc (physics) - //int angles; // ssqc / csqc (physics) - int avelocity; // ssqc / csqc (physics) - int jointtype; // ssqc / csqc (physics) - int enemy; // ssqc / csqc (physics) - int aiment; // ssqc / csqc (physics) - int movedir; // ssqc / csqc (physics) - - int camera_transform; // csqc (warpzones) - - int userwavefunc_param0; // csqc (userwavefunc) - int userwavefunc_param1; // csqc (userwavefunc) - int userwavefunc_param2; // csqc (userwavefunc) - int userwavefunc_param3; // csqc (userwavefunc) - - int crypto_keyfp; // ssqc (DP_CRYPTO) - int crypto_mykeyfp; // ssqc (DP_CRYPTO) - int crypto_idfp; // ssqc (DP_CRYPTO) - int crypto_encryptmethod; // ssqc (DP_CRYPTO) - int crypto_signmethod; // ssqc (DP_CRYPTO) +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) int x; +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function } prvm_prog_fieldoffsets_t; // NOTE: global offsets use -1 for NULL typedef struct prvm_prog_globaloffsets_s { - // server and client use a lot of similar globals, so this is combined - int SV_InitCmd; // ssqc - int self; // common - int time; // ssqc / csqc - int v_forward; // ssqc / csqc - int v_right; // ssqc / csqc - int v_up; // ssqc / csqc - int view_angles; // csqc - int view_punchangle; // csqc - int view_punchvector; // csqc - int trace_allsolid; // ssqc / csqc - int trace_startsolid; // ssqc / csqc - int trace_fraction; // ssqc / csqc - int trace_inwater; // ssqc / csqc - int trace_inopen; // ssqc / csqc - int trace_endpos; // ssqc / csqc - int trace_plane_normal; // ssqc / csqc - int trace_plane_dist; // ssqc / csqc - int trace_ent; // ssqc / csqc - int trace_networkentity; // csqc - int trace_dphitcontents; // ssqc / csqc - int trace_dphitq3surfaceflags; // ssqc / csqc - int trace_dphittexturename; // ssqc / csqc - int trace_dpstartcontents; // ssqc / csqc - int intermission; // csqc - int coop; // csqc - int deathmatch; // csqc - int dmg_take; // csqc - int dmg_save; // csqc - int dmg_origin; // csqc - int sb_showscores; // csqc - int drawfont; // csqc / menu - int drawfontscale; // csqc / menu - int pmove_onground; // csqc - int pmove_inwater; // csqc - int require_spawnfunc_prefix; // ssqc - int worldstatus; // ssqc - int servertime; // csqc - int serverprevtime; // csqc - int serverdeltatime; // csqc - int gettaginfo_name; // ssqc / csqc - int gettaginfo_parent; // ssqc / csqc - int gettaginfo_offset; // ssqc / csqc - int gettaginfo_forward; // ssqc / csqc - int gettaginfo_right; // ssqc / csqc - int gettaginfo_up; // ssqc / csqc - int transparent_offset; // csqc - - int particles_alphamin; // csqc - int particles_alphamax; // csqc - int particles_colormin; // csqc - int particles_colormax; // csqc - - int particle_type; // csqc - int particle_blendmode; // csqc - int particle_orientation; // csqc - int particle_color1; // csqc - int particle_color2; // csqc - int particle_tex; // csqc - int particle_size; // csqc - int particle_sizeincrease; // csqc - int particle_alpha; // csqc - int particle_alphafade; // csqc - int particle_time; // csqc - int particle_gravity; // csqc - int particle_bounce; // csqc - int particle_airfriction; // csqc - int particle_liquidfriction; // csqc - int particle_originjitter; // csqc - int particle_velocityjitter; // csqc - int particle_qualityreduction; // csqc - int particle_stretch; // csqc - int particle_staincolor1; // csqc - int particle_staincolor2; // csqc - int particle_stainalpha; // csqc - int particle_stainsize; // csqc - int particle_staintex; // csqc - int particle_delayspawn; // csqc - int particle_delaycollision; // csqc - int particle_angle; // csqc - int particle_spin; // csqc +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) int x; +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function } prvm_prog_globaloffsets_t; -// these are initialized using PRVM_ED_FindFunction // NOTE: function offsets use 0 for NULL typedef struct prvm_prog_funcoffsets_s { - func_t CSQC_ConsoleCommand; // csqc - func_t CSQC_Ent_Remove; // csqc - func_t CSQC_Ent_Spawn; // csqc DP_CSQC_ENT_SPAWN extension (BlackHC - TODO: needs to be added to dpextensions.qc) - func_t CSQC_Ent_Update; // csqc - func_t CSQC_Event; // csqc [515]: engine call this for its own needs so csqc can do some things according to what engine it's running on. example: to say about edicts increase, whatever... - func_t CSQC_Event_Sound; // csqc : called by engine when an incoming sound packet arrives so CSQC can act on it - func_t CSQC_Init; // csqc - func_t CSQC_InputEvent; // csqc - func_t CSQC_Parse_CenterPrint; // csqc - func_t CSQC_Parse_Print; // csqc - func_t CSQC_Parse_StuffCmd; // csqc - func_t CSQC_Parse_TempEntity; // csqc [515]: very helpfull when you want to create your own particles/decals/etc for effects that already exist - func_t CSQC_Shutdown; // csqc - func_t CSQC_UpdateView; // csqc - func_t Gecko_Query; // csqc, mqc - func_t EndFrame; // ssqc - func_t RestoreGame; // ssqc - func_t SV_ChangeTeam; // ssqc - func_t SV_ParseClientCommand; // ssqc - func_t SV_PlayerPhysics; // ssqc - func_t SV_OnEntityPreSpawnFunction; // ssqc - func_t SV_OnEntityNoSpawnFunction; // ssqc - func_t SV_OnEntityPostSpawnFunction; // ssqc - func_t GameCommand; // any - func_t SV_Shutdown; // ssqc - func_t URI_Get_Callback; // any - func_t SV_PausedTic; //ssqc - - // menu qc only uses some functions, nothing else - func_t m_draw; // mqc - func_t m_init; // mqc - func_t m_keydown; // mqc - func_t m_keyup; // mqc - func_t m_shutdown; // mqc - func_t m_toggle; // mqc - func_t m_newmap; // mqc +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) int x; +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function } prvm_prog_funcoffsets_t; @@ -620,7 +598,7 @@ typedef struct prvm_prog_s prvm_prog_fieldoffsets_t fieldoffsets; prvm_prog_globaloffsets_t globaloffsets; - prvm_prog_funcoffsets_t funcoffsets; + prvm_prog_funcoffsets_t funcoffsets; // allow writing to world entity fields, this is set by server init and // cleared before first server frame diff --git a/prvm_cmds.c b/prvm_cmds.c index 5acc3eb2..819bada0 100644 --- a/prvm_cmds.c +++ b/prvm_cmds.c @@ -5821,7 +5821,7 @@ static void uri_to_string_callback(int status, size_t length_received, unsigned PRVM_SetProg(handle->prognr); PRVM_Begin; - if((prog->starttime == handle->starttime) && (prog->funcoffsets.URI_Get_Callback)) + if((prog->starttime == handle->starttime) && (PRVM_allfunction(URI_Get_Callback))) { if(length_received >= sizeof(handle->buffer)) length_received = sizeof(handle->buffer) - 1; @@ -5830,7 +5830,7 @@ static void uri_to_string_callback(int status, size_t length_received, unsigned PRVM_G_FLOAT(OFS_PARM0) = handle->id; PRVM_G_FLOAT(OFS_PARM1) = status; PRVM_G_INT(OFS_PARM2) = PRVM_SetTempString(handle->buffer); - PRVM_ExecuteProgram(prog->funcoffsets.URI_Get_Callback, "QC function URI_Get_Callback is missing"); + PRVM_ExecuteProgram(PRVM_allfunction(URI_Get_Callback), "QC function URI_Get_Callback is missing"); } PRVM_End; @@ -5856,7 +5856,7 @@ void VM_uri_get (void) const char *query_string = NULL; size_t lq; - if(!prog->funcoffsets.URI_Get_Callback) + if(!PRVM_allfunction(URI_Get_Callback)) PRVM_ERROR("uri_get called by %s without URI_Get_Callback defined", PRVM_NAME); VM_SAFEPARMCOUNTRANGE(2, 6, VM_uri_get); diff --git a/prvm_edict.c b/prvm_edict.c index 85f8badf..fcc0b531 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -1118,7 +1118,7 @@ void PRVM_GameCommand(const char *whichprogs, const char *whichcmd) return; } - if(!prog->funcoffsets.GameCommand) + if(!PRVM_allfunction(GameCommand)) { Con_Printf("%s program do not support GameCommand!\n", whichprogs); } @@ -1131,7 +1131,7 @@ void PRVM_GameCommand(const char *whichprogs, const char *whichcmd) restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(s ? s : ""); - PRVM_ExecuteProgram (prog->funcoffsets.GameCommand, "QC function GameCommand is missing"); + PRVM_ExecuteProgram (PRVM_allfunction(GameCommand), "QC function GameCommand is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; } @@ -1445,11 +1445,11 @@ void PRVM_ED_LoadFromFile (const char *data) continue; } - if (prog->funcoffsets.SV_OnEntityPreSpawnFunction) + if (PRVM_serverfunction(SV_OnEntityPreSpawnFunction)) { // self = ent - PRVM_allglobaledict(self) = PRVM_EDICT_TO_PROG(ent); - PRVM_ExecuteProgram (prog->funcoffsets.SV_OnEntityPreSpawnFunction, "QC function SV_OnEntityPreSpawnFunction is missing"); + PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent); + PRVM_ExecuteProgram (PRVM_serverfunction(SV_OnEntityPreSpawnFunction), "QC function SV_OnEntityPreSpawnFunction is missing"); } if(ent->priv.required->free) @@ -1481,11 +1481,11 @@ void PRVM_ED_LoadFromFile (const char *data) if (!func) { // check for OnEntityNoSpawnFunction - if (prog->funcoffsets.SV_OnEntityNoSpawnFunction) + if (PRVM_serverfunction(SV_OnEntityNoSpawnFunction)) { // self = ent - PRVM_allglobaledict(self) = PRVM_EDICT_TO_PROG(ent); - PRVM_ExecuteProgram (prog->funcoffsets.SV_OnEntityNoSpawnFunction, "QC function SV_OnEntityNoSpawnFunction is missing"); + PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent); + PRVM_ExecuteProgram (PRVM_serverfunction(SV_OnEntityNoSpawnFunction), "QC function SV_OnEntityNoSpawnFunction is missing"); } else { @@ -1507,11 +1507,11 @@ void PRVM_ED_LoadFromFile (const char *data) } if(!ent->priv.required->free) - if (prog->funcoffsets.SV_OnEntityPostSpawnFunction) + if (PRVM_serverfunction(SV_OnEntityPostSpawnFunction)) { // self = ent - PRVM_allglobaledict(self) = PRVM_EDICT_TO_PROG(ent); - PRVM_ExecuteProgram (prog->funcoffsets.SV_OnEntityPostSpawnFunction, "QC function SV_OnEntityPostSpawnFunction is missing"); + PRVM_serverglobaledict(self) = PRVM_EDICT_TO_PROG(ent); + PRVM_ExecuteProgram (PRVM_serverfunction(SV_OnEntityPostSpawnFunction), "QC function SV_OnEntityPostSpawnFunction is missing"); } spawned++; @@ -1529,264 +1529,81 @@ void PRVM_FindOffsets(void) // field and global searches use -1 for NULL memset(&prog->fieldoffsets, -1, sizeof(prog->fieldoffsets)); memset(&prog->globaloffsets, -1, sizeof(prog->globaloffsets)); - // functions use 0 for NULL + // function searches use 0 for NULL memset(&prog->funcoffsets, 0, sizeof(prog->funcoffsets)); - - // server and client qc use a lot of similar fields, so this is combined - prog->fieldoffsets.SendEntity = PRVM_ED_FindFieldOffset("SendEntity"); - prog->fieldoffsets.SendFlags = PRVM_ED_FindFieldOffset("SendFlags"); - prog->fieldoffsets.Version = PRVM_ED_FindFieldOffset("Version"); - prog->fieldoffsets.alpha = PRVM_ED_FindFieldOffset("alpha"); - prog->fieldoffsets.ammo_cells1 = PRVM_ED_FindFieldOffset("ammo_cells1"); - prog->fieldoffsets.ammo_lava_nails = PRVM_ED_FindFieldOffset("ammo_lava_nails"); - prog->fieldoffsets.ammo_multi_rockets = PRVM_ED_FindFieldOffset("ammo_multi_rockets"); - prog->fieldoffsets.ammo_nails1 = PRVM_ED_FindFieldOffset("ammo_nails1"); - prog->fieldoffsets.ammo_plasma = PRVM_ED_FindFieldOffset("ammo_plasma"); - prog->fieldoffsets.ammo_rockets1 = PRVM_ED_FindFieldOffset("ammo_rockets1"); - prog->fieldoffsets.ammo_shells1 = PRVM_ED_FindFieldOffset("ammo_shells1"); - prog->fieldoffsets.angles = PRVM_ED_FindFieldOffset("angles"); - prog->fieldoffsets.button3 = PRVM_ED_FindFieldOffset("button3"); - prog->fieldoffsets.button4 = PRVM_ED_FindFieldOffset("button4"); - prog->fieldoffsets.button5 = PRVM_ED_FindFieldOffset("button5"); - prog->fieldoffsets.button6 = PRVM_ED_FindFieldOffset("button6"); - prog->fieldoffsets.button7 = PRVM_ED_FindFieldOffset("button7"); - prog->fieldoffsets.button8 = PRVM_ED_FindFieldOffset("button8"); - prog->fieldoffsets.button9 = PRVM_ED_FindFieldOffset("button9"); - prog->fieldoffsets.button10 = PRVM_ED_FindFieldOffset("button10"); - prog->fieldoffsets.button11 = PRVM_ED_FindFieldOffset("button11"); - prog->fieldoffsets.button12 = PRVM_ED_FindFieldOffset("button12"); - prog->fieldoffsets.button13 = PRVM_ED_FindFieldOffset("button13"); - prog->fieldoffsets.button14 = PRVM_ED_FindFieldOffset("button14"); - prog->fieldoffsets.button15 = PRVM_ED_FindFieldOffset("button15"); - prog->fieldoffsets.button16 = PRVM_ED_FindFieldOffset("button16"); - prog->fieldoffsets.buttonchat = PRVM_ED_FindFieldOffset("buttonchat"); - prog->fieldoffsets.buttonuse = PRVM_ED_FindFieldOffset("buttonuse"); - prog->fieldoffsets.chain = PRVM_ED_FindFieldOffset("chain"); - prog->fieldoffsets.classname = PRVM_ED_FindFieldOffset("classname"); - prog->fieldoffsets.clientcamera = PRVM_ED_FindFieldOffset("clientcamera"); - prog->fieldoffsets.clientcolors = PRVM_ED_FindFieldOffset("clientcolors"); - prog->fieldoffsets.clientstatus = PRVM_ED_FindFieldOffset("clientstatus"); - prog->fieldoffsets.color = PRVM_ED_FindFieldOffset("color"); - prog->fieldoffsets.colormod = PRVM_ED_FindFieldOffset("colormod"); - prog->fieldoffsets.contentstransition = PRVM_ED_FindFieldOffset("contentstransition"); - prog->fieldoffsets.cursor_active = PRVM_ED_FindFieldOffset("cursor_active"); - prog->fieldoffsets.cursor_screen = PRVM_ED_FindFieldOffset("cursor_screen"); - prog->fieldoffsets.cursor_trace_endpos = PRVM_ED_FindFieldOffset("cursor_trace_endpos"); - prog->fieldoffsets.cursor_trace_ent = PRVM_ED_FindFieldOffset("cursor_trace_ent"); - prog->fieldoffsets.cursor_trace_start = PRVM_ED_FindFieldOffset("cursor_trace_start"); - prog->fieldoffsets.customizeentityforclient = PRVM_ED_FindFieldOffset("customizeentityforclient"); - prog->fieldoffsets.dimension_hit = PRVM_ED_FindFieldOffset("dimension_hit"); - prog->fieldoffsets.dimension_solid = PRVM_ED_FindFieldOffset("dimension_solid"); - prog->fieldoffsets.disableclientprediction = PRVM_ED_FindFieldOffset("disableclientprediction"); - prog->fieldoffsets.discardabledemo = PRVM_ED_FindFieldOffset("discardabledemo"); - prog->fieldoffsets.dphitcontentsmask = PRVM_ED_FindFieldOffset("dphitcontentsmask"); - prog->fieldoffsets.drawonlytoclient = PRVM_ED_FindFieldOffset("drawonlytoclient"); - prog->fieldoffsets.exteriormodeltoclient = PRVM_ED_FindFieldOffset("exteriormodeltoclient"); - prog->fieldoffsets.fatness = PRVM_ED_FindFieldOffset("fatness"); - prog->fieldoffsets.forceshader = PRVM_ED_FindFieldOffset("forceshader"); - prog->fieldoffsets.frame = PRVM_ED_FindFieldOffset("frame"); - prog->fieldoffsets.frame1time = PRVM_ED_FindFieldOffset("frame1time"); - prog->fieldoffsets.frame2 = PRVM_ED_FindFieldOffset("frame2"); - prog->fieldoffsets.frame2time = PRVM_ED_FindFieldOffset("frame2time"); - prog->fieldoffsets.frame3 = PRVM_ED_FindFieldOffset("frame3"); - prog->fieldoffsets.frame3time = PRVM_ED_FindFieldOffset("frame3time"); - prog->fieldoffsets.frame4 = PRVM_ED_FindFieldOffset("frame4"); - prog->fieldoffsets.frame4time = PRVM_ED_FindFieldOffset("frame4time"); - prog->fieldoffsets.fullbright = PRVM_ED_FindFieldOffset("fullbright"); - prog->fieldoffsets.glow_color = PRVM_ED_FindFieldOffset("glow_color"); - prog->fieldoffsets.glow_size = PRVM_ED_FindFieldOffset("glow_size"); - prog->fieldoffsets.glow_trail = PRVM_ED_FindFieldOffset("glow_trail"); - prog->fieldoffsets.glowmod = PRVM_ED_FindFieldOffset("glowmod"); - prog->fieldoffsets.gravity = PRVM_ED_FindFieldOffset("gravity"); - prog->fieldoffsets.groundentity = PRVM_ED_FindFieldOffset("groundentity"); - prog->fieldoffsets.hull = PRVM_ED_FindFieldOffset("hull"); - prog->fieldoffsets.ideal_yaw = PRVM_ED_FindFieldOffset("ideal_yaw"); - prog->fieldoffsets.idealpitch = PRVM_ED_FindFieldOffset("idealpitch"); - prog->fieldoffsets.items2 = PRVM_ED_FindFieldOffset("items2"); - prog->fieldoffsets.lerpfrac = PRVM_ED_FindFieldOffset("lerpfrac"); - prog->fieldoffsets.lerpfrac3 = PRVM_ED_FindFieldOffset("lerpfrac3"); - prog->fieldoffsets.lerpfrac4 = PRVM_ED_FindFieldOffset("lerpfrac4"); - prog->fieldoffsets.light_lev = PRVM_ED_FindFieldOffset("light_lev"); - prog->fieldoffsets.message = PRVM_ED_FindFieldOffset("message"); - prog->fieldoffsets.modelflags = PRVM_ED_FindFieldOffset("modelflags"); - prog->fieldoffsets.movement = PRVM_ED_FindFieldOffset("movement"); - prog->fieldoffsets.movetypesteplandevent = PRVM_ED_FindFieldOffset("movetypesteplandevent"); - prog->fieldoffsets.netaddress = PRVM_ED_FindFieldOffset("netaddress"); - prog->fieldoffsets.nextthink = PRVM_ED_FindFieldOffset("nextthink"); - prog->fieldoffsets.nodrawtoclient = PRVM_ED_FindFieldOffset("nodrawtoclient"); - prog->fieldoffsets.pflags = PRVM_ED_FindFieldOffset("pflags"); - prog->fieldoffsets.ping = PRVM_ED_FindFieldOffset("ping"); - prog->fieldoffsets.ping_packetloss = PRVM_ED_FindFieldOffset("ping_packetloss"); - prog->fieldoffsets.ping_movementloss = PRVM_ED_FindFieldOffset("ping_movementloss"); - prog->fieldoffsets.pitch_speed = PRVM_ED_FindFieldOffset("pitch_speed"); - prog->fieldoffsets.playermodel = PRVM_ED_FindFieldOffset("playermodel"); - prog->fieldoffsets.playerskin = PRVM_ED_FindFieldOffset("playerskin"); - prog->fieldoffsets.pmodel = PRVM_ED_FindFieldOffset("pmodel"); - prog->fieldoffsets.punchvector = PRVM_ED_FindFieldOffset("punchvector"); - prog->fieldoffsets.renderamt = PRVM_ED_FindFieldOffset("renderamt"); // HalfLife support - prog->fieldoffsets.renderflags = PRVM_ED_FindFieldOffset("renderflags"); - prog->fieldoffsets.rendermode = PRVM_ED_FindFieldOffset("rendermode"); // HalfLife support - prog->fieldoffsets.scale = PRVM_ED_FindFieldOffset("scale"); - prog->fieldoffsets.shadertime = PRVM_ED_FindFieldOffset("shadertime"); - prog->fieldoffsets.skeletonindex = PRVM_ED_FindFieldOffset("skeletonindex"); - prog->fieldoffsets.style = PRVM_ED_FindFieldOffset("style"); - prog->fieldoffsets.tag_entity = PRVM_ED_FindFieldOffset("tag_entity"); - prog->fieldoffsets.tag_index = PRVM_ED_FindFieldOffset("tag_index"); - prog->fieldoffsets.think = PRVM_ED_FindFieldOffset("think"); - prog->fieldoffsets.viewmodelforclient = PRVM_ED_FindFieldOffset("viewmodelforclient"); - prog->fieldoffsets.viewzoom = PRVM_ED_FindFieldOffset("viewzoom"); - prog->fieldoffsets.yaw_speed = PRVM_ED_FindFieldOffset("yaw_speed"); - prog->fieldoffsets.bouncefactor = PRVM_ED_FindFieldOffset("bouncefactor"); - prog->fieldoffsets.bouncestop = PRVM_ED_FindFieldOffset("bouncestop"); - prog->fieldoffsets.sendcomplexanimation = PRVM_ED_FindFieldOffset("sendcomplexanimation"); - - prog->fieldoffsets.solid = PRVM_ED_FindFieldOffset("solid"); - prog->fieldoffsets.movetype = PRVM_ED_FindFieldOffset("movetype"); - prog->fieldoffsets.modelindex = PRVM_ED_FindFieldOffset("modelindex"); - prog->fieldoffsets.mins = PRVM_ED_FindFieldOffset("mins"); - prog->fieldoffsets.maxs = PRVM_ED_FindFieldOffset("maxs"); - prog->fieldoffsets.mass = PRVM_ED_FindFieldOffset("mass"); - prog->fieldoffsets.origin = PRVM_ED_FindFieldOffset("origin"); - prog->fieldoffsets.velocity = PRVM_ED_FindFieldOffset("velocity"); - //prog->fieldoffsets.axis_forward = PRVM_ED_FindFieldOffset("axis_forward"); - //prog->fieldoffsets.axis_left = PRVM_ED_FindFieldOffset("axis_left"); - //prog->fieldoffsets.axis_up = PRVM_ED_FindFieldOffset("axis_up"); - //prog->fieldoffsets.spinvelocity = PRVM_ED_FindFieldOffset("spinvelocity"); - prog->fieldoffsets.angles = PRVM_ED_FindFieldOffset("angles"); - prog->fieldoffsets.avelocity = PRVM_ED_FindFieldOffset("avelocity"); - prog->fieldoffsets.aiment = PRVM_ED_FindFieldOffset("aiment"); - prog->fieldoffsets.enemy = PRVM_ED_FindFieldOffset("enemy"); - prog->fieldoffsets.jointtype = PRVM_ED_FindFieldOffset("jointtype"); - prog->fieldoffsets.movedir = PRVM_ED_FindFieldOffset("movedir"); - - prog->fieldoffsets.camera_transform = PRVM_ED_FindFieldOffset("camera_transform"); - prog->fieldoffsets.userwavefunc_param0 = PRVM_ED_FindFieldOffset("userwavefunc_param0"); - prog->fieldoffsets.userwavefunc_param1 = PRVM_ED_FindFieldOffset("userwavefunc_param1"); - prog->fieldoffsets.userwavefunc_param2 = PRVM_ED_FindFieldOffset("userwavefunc_param2"); - prog->fieldoffsets.userwavefunc_param3 = PRVM_ED_FindFieldOffset("userwavefunc_param3"); - - prog->fieldoffsets.crypto_keyfp = PRVM_ED_FindFieldOffset("crypto_keyfp"); - prog->fieldoffsets.crypto_mykeyfp = PRVM_ED_FindFieldOffset("crypto_mykeyfp"); - prog->fieldoffsets.crypto_idfp = PRVM_ED_FindFieldOffset("crypto_idfp"); - prog->fieldoffsets.crypto_encryptmethod = PRVM_ED_FindFieldOffset("crypto_encryptmethod"); - prog->fieldoffsets.crypto_signmethod = PRVM_ED_FindFieldOffset("crypto_signmethod"); - - prog->funcoffsets.CSQC_ConsoleCommand = PRVM_ED_FindFunctionOffset("CSQC_ConsoleCommand"); - prog->funcoffsets.CSQC_Ent_Remove = PRVM_ED_FindFunctionOffset("CSQC_Ent_Remove"); - prog->funcoffsets.CSQC_Ent_Spawn = PRVM_ED_FindFunctionOffset("CSQC_Ent_Spawn"); - prog->funcoffsets.CSQC_Ent_Update = PRVM_ED_FindFunctionOffset("CSQC_Ent_Update"); - prog->funcoffsets.CSQC_Event = PRVM_ED_FindFunctionOffset("CSQC_Event"); - prog->funcoffsets.CSQC_Event_Sound = PRVM_ED_FindFunctionOffset("CSQC_Event_Sound"); - prog->funcoffsets.CSQC_Init = PRVM_ED_FindFunctionOffset("CSQC_Init"); - prog->funcoffsets.CSQC_InputEvent = PRVM_ED_FindFunctionOffset("CSQC_InputEvent"); - prog->funcoffsets.CSQC_Parse_CenterPrint = PRVM_ED_FindFunctionOffset("CSQC_Parse_CenterPrint"); - prog->funcoffsets.CSQC_Parse_Print = PRVM_ED_FindFunctionOffset("CSQC_Parse_Print"); - prog->funcoffsets.CSQC_Parse_StuffCmd = PRVM_ED_FindFunctionOffset("CSQC_Parse_StuffCmd"); - prog->funcoffsets.CSQC_Parse_TempEntity = PRVM_ED_FindFunctionOffset("CSQC_Parse_TempEntity"); - prog->funcoffsets.CSQC_Shutdown = PRVM_ED_FindFunctionOffset("CSQC_Shutdown"); - prog->funcoffsets.CSQC_UpdateView = PRVM_ED_FindFunctionOffset("CSQC_UpdateView"); - prog->funcoffsets.EndFrame = PRVM_ED_FindFunctionOffset("EndFrame"); - prog->funcoffsets.GameCommand = PRVM_ED_FindFunctionOffset("GameCommand"); - prog->funcoffsets.Gecko_Query = PRVM_ED_FindFunctionOffset("Gecko_Query"); - prog->funcoffsets.RestoreGame = PRVM_ED_FindFunctionOffset("RestoreGame"); - prog->funcoffsets.SV_ChangeTeam = PRVM_ED_FindFunctionOffset("SV_ChangeTeam"); - prog->funcoffsets.SV_OnEntityNoSpawnFunction = PRVM_ED_FindFunctionOffset("SV_OnEntityNoSpawnFunction"); - prog->funcoffsets.SV_OnEntityPostSpawnFunction = PRVM_ED_FindFunctionOffset("SV_OnEntityPostSpawnFunction"); - prog->funcoffsets.SV_OnEntityPreSpawnFunction = PRVM_ED_FindFunctionOffset("SV_OnEntityPreSpawnFunction"); - prog->funcoffsets.SV_ParseClientCommand = PRVM_ED_FindFunctionOffset("SV_ParseClientCommand"); - prog->funcoffsets.SV_PausedTic = PRVM_ED_FindFunctionOffset("SV_PausedTic"); - prog->funcoffsets.SV_PlayerPhysics = PRVM_ED_FindFunctionOffset("SV_PlayerPhysics"); - prog->funcoffsets.SV_Shutdown = PRVM_ED_FindFunctionOffset("SV_Shutdown"); - prog->funcoffsets.URI_Get_Callback = PRVM_ED_FindFunctionOffset("URI_Get_Callback"); - prog->globaloffsets.SV_InitCmd = PRVM_ED_FindGlobalOffset("SV_InitCmd"); - prog->globaloffsets.coop = PRVM_ED_FindGlobalOffset("coop"); - prog->globaloffsets.deathmatch = PRVM_ED_FindGlobalOffset("deathmatch"); - prog->globaloffsets.dmg_origin = PRVM_ED_FindGlobalOffset("dmg_origin"); - prog->globaloffsets.dmg_save = PRVM_ED_FindGlobalOffset("dmg_save"); - prog->globaloffsets.dmg_take = PRVM_ED_FindGlobalOffset("dmg_take"); - prog->globaloffsets.drawfont = PRVM_ED_FindGlobalOffset("drawfont"); - prog->globaloffsets.drawfontscale = PRVM_ED_FindGlobalOffset("drawfontscale"); - prog->globaloffsets.gettaginfo_forward = PRVM_ED_FindGlobalOffset("gettaginfo_forward"); - prog->globaloffsets.gettaginfo_name = PRVM_ED_FindGlobalOffset("gettaginfo_name"); - prog->globaloffsets.gettaginfo_offset = PRVM_ED_FindGlobalOffset("gettaginfo_offset"); - prog->globaloffsets.gettaginfo_parent = PRVM_ED_FindGlobalOffset("gettaginfo_parent"); - prog->globaloffsets.gettaginfo_right = PRVM_ED_FindGlobalOffset("gettaginfo_right"); - prog->globaloffsets.gettaginfo_up = PRVM_ED_FindGlobalOffset("gettaginfo_up"); - prog->globaloffsets.transparent_offset = PRVM_ED_FindGlobalOffset("transparent_offset"); - prog->globaloffsets.intermission = PRVM_ED_FindGlobalOffset("intermission"); - prog->globaloffsets.require_spawnfunc_prefix = PRVM_ED_FindGlobalOffset("require_spawnfunc_prefix"); - prog->globaloffsets.sb_showscores = PRVM_ED_FindGlobalOffset("sb_showscores"); - prog->globaloffsets.self = PRVM_ED_FindGlobalOffset("self"); - prog->globaloffsets.serverdeltatime = PRVM_ED_FindGlobalOffset("serverdeltatime"); - prog->globaloffsets.serverprevtime = PRVM_ED_FindGlobalOffset("serverprevtime"); - prog->globaloffsets.servertime = PRVM_ED_FindGlobalOffset("servertime"); - prog->globaloffsets.time = PRVM_ED_FindGlobalOffset("time"); - prog->globaloffsets.trace_allsolid = PRVM_ED_FindGlobalOffset("trace_allsolid"); - prog->globaloffsets.trace_dphitcontents = PRVM_ED_FindGlobalOffset("trace_dphitcontents"); - prog->globaloffsets.trace_dphitq3surfaceflags = PRVM_ED_FindGlobalOffset("trace_dphitq3surfaceflags"); - prog->globaloffsets.trace_dphittexturename = PRVM_ED_FindGlobalOffset("trace_dphittexturename"); - prog->globaloffsets.trace_dpstartcontents = PRVM_ED_FindGlobalOffset("trace_dpstartcontents"); - prog->globaloffsets.trace_endpos = PRVM_ED_FindGlobalOffset("trace_endpos"); - prog->globaloffsets.trace_ent = PRVM_ED_FindGlobalOffset("trace_ent"); - prog->globaloffsets.trace_fraction = PRVM_ED_FindGlobalOffset("trace_fraction"); - prog->globaloffsets.trace_inopen = PRVM_ED_FindGlobalOffset("trace_inopen"); - prog->globaloffsets.trace_inwater = PRVM_ED_FindGlobalOffset("trace_inwater"); - prog->globaloffsets.trace_networkentity = PRVM_ED_FindGlobalOffset("trace_networkentity"); - prog->globaloffsets.trace_plane_dist = PRVM_ED_FindGlobalOffset("trace_plane_dist"); - prog->globaloffsets.trace_plane_normal = PRVM_ED_FindGlobalOffset("trace_plane_normal"); - prog->globaloffsets.trace_startsolid = PRVM_ED_FindGlobalOffset("trace_startsolid"); - prog->globaloffsets.v_forward = PRVM_ED_FindGlobalOffset("v_forward"); - prog->globaloffsets.v_right = PRVM_ED_FindGlobalOffset("v_right"); - prog->globaloffsets.v_up = PRVM_ED_FindGlobalOffset("v_up"); - prog->globaloffsets.view_angles = PRVM_ED_FindGlobalOffset("view_angles"); - prog->globaloffsets.view_punchangle = PRVM_ED_FindGlobalOffset("view_punchangle"); - prog->globaloffsets.view_punchvector = PRVM_ED_FindGlobalOffset("view_punchvector"); - prog->globaloffsets.worldstatus = PRVM_ED_FindGlobalOffset("worldstatus"); - prog->globaloffsets.particles_alphamin = PRVM_ED_FindGlobalOffset("particles_alphamin"); - prog->globaloffsets.particles_alphamax = PRVM_ED_FindGlobalOffset("particles_alphamax"); - prog->globaloffsets.particles_colormin = PRVM_ED_FindGlobalOffset("particles_colormin"); - prog->globaloffsets.particles_colormax = PRVM_ED_FindGlobalOffset("particles_colormax"); - prog->globaloffsets.pmove_onground = PRVM_ED_FindGlobalOffset("pmove_onground"); - prog->globaloffsets.pmove_inwater = PRVM_ED_FindGlobalOffset("pmove_inwater"); - - prog->globaloffsets.particle_type = PRVM_ED_FindGlobalOffset("particle_type"); - prog->globaloffsets.particle_blendmode = PRVM_ED_FindGlobalOffset("particle_blendmode"); - prog->globaloffsets.particle_orientation = PRVM_ED_FindGlobalOffset("particle_orientation"); - prog->globaloffsets.particle_color1 = PRVM_ED_FindGlobalOffset("particle_color1"); - prog->globaloffsets.particle_color2 = PRVM_ED_FindGlobalOffset("particle_color2"); - prog->globaloffsets.particle_tex = PRVM_ED_FindGlobalOffset("particle_tex"); - prog->globaloffsets.particle_size = PRVM_ED_FindGlobalOffset("particle_size"); - prog->globaloffsets.particle_sizeincrease = PRVM_ED_FindGlobalOffset("particle_sizeincrease"); - prog->globaloffsets.particle_alpha = PRVM_ED_FindGlobalOffset("particle_alpha"); - prog->globaloffsets.particle_alphafade = PRVM_ED_FindGlobalOffset("particle_alphafade"); - prog->globaloffsets.particle_time = PRVM_ED_FindGlobalOffset("particle_time"); - prog->globaloffsets.particle_gravity = PRVM_ED_FindGlobalOffset("particle_gravity"); - prog->globaloffsets.particle_bounce = PRVM_ED_FindGlobalOffset("particle_bounce"); - prog->globaloffsets.particle_airfriction = PRVM_ED_FindGlobalOffset("particle_airfriction"); - prog->globaloffsets.particle_liquidfriction = PRVM_ED_FindGlobalOffset("particle_liquidfriction"); - prog->globaloffsets.particle_originjitter = PRVM_ED_FindGlobalOffset("particle_originjitter"); - prog->globaloffsets.particle_velocityjitter = PRVM_ED_FindGlobalOffset("particle_velocityjitter"); - prog->globaloffsets.particle_qualityreduction = PRVM_ED_FindGlobalOffset("particle_qualityreduction"); - prog->globaloffsets.particle_stretch = PRVM_ED_FindGlobalOffset("particle_stretch"); - prog->globaloffsets.particle_staincolor1 = PRVM_ED_FindGlobalOffset("particle_staincolor1"); - prog->globaloffsets.particle_staincolor2 = PRVM_ED_FindGlobalOffset("particle_staincolor2"); - prog->globaloffsets.particle_stainalpha = PRVM_ED_FindGlobalOffset("particle_stainalpha"); - prog->globaloffsets.particle_stainsize = PRVM_ED_FindGlobalOffset("particle_stainsize"); - prog->globaloffsets.particle_staintex = PRVM_ED_FindGlobalOffset("particle_staintex"); - prog->globaloffsets.particle_staintex = PRVM_ED_FindGlobalOffset("particle_staintex"); - prog->globaloffsets.particle_delayspawn = PRVM_ED_FindGlobalOffset("particle_delayspawn"); - prog->globaloffsets.particle_delaycollision = PRVM_ED_FindGlobalOffset("particle_delaycollision"); - prog->globaloffsets.particle_angle = PRVM_ED_FindGlobalOffset("particle_angle"); - prog->globaloffsets.particle_spin = PRVM_ED_FindGlobalOffset("particle_spin"); - - // menu qc only uses some functions, nothing else - prog->funcoffsets.m_draw = PRVM_ED_FindFunctionOffset("m_draw"); - prog->funcoffsets.m_init = PRVM_ED_FindFunctionOffset("m_init"); - prog->funcoffsets.m_keydown = PRVM_ED_FindFunctionOffset("m_keydown"); - prog->funcoffsets.m_keyup = PRVM_ED_FindFunctionOffset("m_keyup"); - prog->funcoffsets.m_shutdown = PRVM_ED_FindFunctionOffset("m_shutdown"); - prog->funcoffsets.m_toggle = PRVM_ED_FindFunctionOffset("m_toggle"); - prog->funcoffsets.m_newmap = PRVM_ED_FindFunctionOffset("m_newmap"); +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) prog->fieldoffsets.x = PRVM_ED_FindFieldOffset(#x); +#define PRVM_DECLARE_global(x) prog->globaloffsets.x = PRVM_ED_FindGlobalOffset(#x); +#define PRVM_DECLARE_function(x) prog->funcoffsets.x = PRVM_ED_FindFunctionOffset(#x); +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function } // not used diff --git a/prvm_exec.c b/prvm_exec.c index c958a311..8fb0d692 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -523,7 +523,7 @@ void PRVM_Crash(void) if (prog == NULL) return; - prog->funcoffsets.SV_Shutdown = 0; // don't call SV_Shutdown on crash + PRVM_serverfunction(SV_Shutdown) = 0; // don't call SV_Shutdown on crash if( prog->depth > 0 ) { diff --git a/prvm_offsets.h b/prvm_offsets.h new file mode 100644 index 00000000..bc69ad24 --- /dev/null +++ b/prvm_offsets.h @@ -0,0 +1,810 @@ +PRVM_DECLARE_clientfieldedict(aiment) +PRVM_DECLARE_clientfieldedict(chain) +PRVM_DECLARE_clientfieldedict(enemy) +PRVM_DECLARE_clientfieldedict(groundentity) +PRVM_DECLARE_clientfieldedict(owner) +PRVM_DECLARE_clientfieldedict(tag_entity) +PRVM_DECLARE_clientfieldfloat(alpha) +PRVM_DECLARE_clientfieldfloat(bouncefactor) +PRVM_DECLARE_clientfieldfloat(bouncestop) +PRVM_DECLARE_clientfieldfloat(colormap) +PRVM_DECLARE_clientfieldfloat(dphitcontentsmask) +PRVM_DECLARE_clientfieldfloat(drawmask) +PRVM_DECLARE_clientfieldfloat(effects) +PRVM_DECLARE_clientfieldfloat(entnum) +PRVM_DECLARE_clientfieldfloat(flags) +PRVM_DECLARE_clientfieldfloat(frame) +PRVM_DECLARE_clientfieldfloat(frame1time) +PRVM_DECLARE_clientfieldfloat(frame2) +PRVM_DECLARE_clientfieldfloat(frame2time) +PRVM_DECLARE_clientfieldfloat(frame3) +PRVM_DECLARE_clientfieldfloat(frame3time) +PRVM_DECLARE_clientfieldfloat(frame4) +PRVM_DECLARE_clientfieldfloat(frame4time) +PRVM_DECLARE_clientfieldfloat(gravity) +PRVM_DECLARE_clientfieldfloat(ideal_yaw) +PRVM_DECLARE_clientfieldfloat(idealpitch) +PRVM_DECLARE_clientfieldfloat(jointtype) +PRVM_DECLARE_clientfieldfloat(lerpfrac) +PRVM_DECLARE_clientfieldfloat(lerpfrac3) +PRVM_DECLARE_clientfieldfloat(lerpfrac4) +PRVM_DECLARE_clientfieldfloat(mass) +PRVM_DECLARE_clientfieldfloat(modelindex) +PRVM_DECLARE_clientfieldfloat(movetype) +PRVM_DECLARE_clientfieldfloat(nextthink) +PRVM_DECLARE_clientfieldfloat(pitch_speed) +PRVM_DECLARE_clientfieldfloat(renderflags) +PRVM_DECLARE_clientfieldfloat(scale) +PRVM_DECLARE_clientfieldfloat(shadertime) +PRVM_DECLARE_clientfieldfloat(skeletonindex) +PRVM_DECLARE_clientfieldfloat(skin) +PRVM_DECLARE_clientfieldfloat(solid) +PRVM_DECLARE_clientfieldfloat(tag_index) +PRVM_DECLARE_clientfieldfloat(userwavefunc_param0) +PRVM_DECLARE_clientfieldfloat(userwavefunc_param1) +PRVM_DECLARE_clientfieldfloat(userwavefunc_param2) +PRVM_DECLARE_clientfieldfloat(userwavefunc_param3) +PRVM_DECLARE_clientfieldfloat(yaw_speed) +PRVM_DECLARE_clientfieldfunction(blocked) +PRVM_DECLARE_clientfieldfunction(camera_transform) +PRVM_DECLARE_clientfieldfunction(predraw) +PRVM_DECLARE_clientfieldfunction(think) +PRVM_DECLARE_clientfieldfunction(touch) +PRVM_DECLARE_clientfieldfunction(use) +PRVM_DECLARE_clientfieldstring(classname) +PRVM_DECLARE_clientfieldstring(message) +PRVM_DECLARE_clientfieldstring(model) +PRVM_DECLARE_clientfieldstring(netname) +PRVM_DECLARE_clientfieldvector(absmax) +PRVM_DECLARE_clientfieldvector(absmin) +PRVM_DECLARE_clientfieldvector(angles) +PRVM_DECLARE_clientfieldvector(avelocity) +PRVM_DECLARE_clientfieldvector(colormod) +PRVM_DECLARE_clientfieldvector(glowmod) +PRVM_DECLARE_clientfieldvector(maxs) +PRVM_DECLARE_clientfieldvector(mins) +PRVM_DECLARE_clientfieldvector(movedir) +PRVM_DECLARE_clientfieldvector(oldorigin) +PRVM_DECLARE_clientfieldvector(origin) +PRVM_DECLARE_clientfieldvector(size) +PRVM_DECLARE_clientfieldvector(velocity) +PRVM_DECLARE_clientfunction(CSQC_ConsoleCommand) +PRVM_DECLARE_clientfunction(CSQC_Ent_Remove) +PRVM_DECLARE_clientfunction(CSQC_Ent_Spawn) +PRVM_DECLARE_clientfunction(CSQC_Ent_Update) +PRVM_DECLARE_clientfunction(CSQC_Event) +PRVM_DECLARE_clientfunction(CSQC_Event_Sound) +PRVM_DECLARE_clientfunction(CSQC_Init) +PRVM_DECLARE_clientfunction(CSQC_InputEvent) +PRVM_DECLARE_clientfunction(CSQC_Parse_CenterPrint) +PRVM_DECLARE_clientfunction(CSQC_Parse_Print) +PRVM_DECLARE_clientfunction(CSQC_Parse_StuffCmd) +PRVM_DECLARE_clientfunction(CSQC_Parse_TempEntity) +PRVM_DECLARE_clientfunction(CSQC_Shutdown) +PRVM_DECLARE_clientfunction(CSQC_UpdateView) +PRVM_DECLARE_clientfunction(GameCommand) +PRVM_DECLARE_clientfunction(Gecko_Query) +PRVM_DECLARE_clientfunction(URI_Get_Callback) +PRVM_DECLARE_clientglobaledict(other) +PRVM_DECLARE_clientglobaledict(self) +PRVM_DECLARE_clientglobaledict(trace_ent) +PRVM_DECLARE_clientglobaledict(world) +PRVM_DECLARE_clientglobalfloat(clientcommandframe) +PRVM_DECLARE_clientglobalfloat(coop) +PRVM_DECLARE_clientglobalfloat(deathmatch) +PRVM_DECLARE_clientglobalfloat(dmg_save) +PRVM_DECLARE_clientglobalfloat(dmg_take) +PRVM_DECLARE_clientglobalfloat(drawfont) +PRVM_DECLARE_clientglobalfloat(frametime) +PRVM_DECLARE_clientglobalfloat(gettaginfo_parent) +PRVM_DECLARE_clientglobalfloat(input_buttons) +PRVM_DECLARE_clientglobalfloat(input_timelength) +PRVM_DECLARE_clientglobalfloat(intermission) +PRVM_DECLARE_clientglobalfloat(maxclients) +PRVM_DECLARE_clientglobalfloat(movevar_accelerate) +PRVM_DECLARE_clientglobalfloat(movevar_airaccelerate) +PRVM_DECLARE_clientglobalfloat(movevar_entgravity) +PRVM_DECLARE_clientglobalfloat(movevar_friction) +PRVM_DECLARE_clientglobalfloat(movevar_gravity) +PRVM_DECLARE_clientglobalfloat(movevar_maxspeed) +PRVM_DECLARE_clientglobalfloat(movevar_spectatormaxspeed) +PRVM_DECLARE_clientglobalfloat(movevar_stopspeed) +PRVM_DECLARE_clientglobalfloat(movevar_wateraccelerate) +PRVM_DECLARE_clientglobalfloat(movevar_waterfriction) +PRVM_DECLARE_clientglobalfloat(particle_airfriction) +PRVM_DECLARE_clientglobalfloat(particle_alpha) +PRVM_DECLARE_clientglobalfloat(particle_alphafade) +PRVM_DECLARE_clientglobalfloat(particle_angle) +PRVM_DECLARE_clientglobalfloat(particle_blendmode) +PRVM_DECLARE_clientglobalfloat(particle_bounce) +PRVM_DECLARE_clientglobalfloat(particle_delaycollision) +PRVM_DECLARE_clientglobalfloat(particle_delayspawn) +PRVM_DECLARE_clientglobalfloat(particle_gravity) +PRVM_DECLARE_clientglobalfloat(particle_liquidfriction) +PRVM_DECLARE_clientglobalfloat(particle_orientation) +PRVM_DECLARE_clientglobalfloat(particle_originjitter) +PRVM_DECLARE_clientglobalfloat(particle_qualityreduction) +PRVM_DECLARE_clientglobalfloat(particle_size) +PRVM_DECLARE_clientglobalfloat(particle_sizeincrease) +PRVM_DECLARE_clientglobalfloat(particle_spin) +PRVM_DECLARE_clientglobalfloat(particle_stainalpha) +PRVM_DECLARE_clientglobalfloat(particle_stainsize) +PRVM_DECLARE_clientglobalfloat(particle_staintex) +PRVM_DECLARE_clientglobalfloat(particle_stretch) +PRVM_DECLARE_clientglobalfloat(particle_tex) +PRVM_DECLARE_clientglobalfloat(particle_time) +PRVM_DECLARE_clientglobalfloat(particle_type) +PRVM_DECLARE_clientglobalfloat(particle_velocityjitter) +PRVM_DECLARE_clientglobalfloat(particles_alphamax) +PRVM_DECLARE_clientglobalfloat(particles_alphamin) +PRVM_DECLARE_clientglobalfloat(player_localentnum) +PRVM_DECLARE_clientglobalfloat(player_localnum) +PRVM_DECLARE_clientglobalfloat(require_spawnfunc_prefix) +PRVM_DECLARE_clientglobalfloat(sb_showscores) +PRVM_DECLARE_clientglobalfloat(servercommandframe) +PRVM_DECLARE_clientglobalfloat(serverdeltatime) +PRVM_DECLARE_clientglobalfloat(serverprevtime) +PRVM_DECLARE_clientglobalfloat(servertime) +PRVM_DECLARE_clientglobalfloat(time) +PRVM_DECLARE_clientglobalfloat(trace_allsolid) +PRVM_DECLARE_clientglobalfloat(trace_dphitcontents) +PRVM_DECLARE_clientglobalfloat(trace_dphitq3surfaceflags) +PRVM_DECLARE_clientglobalfloat(trace_dpstartcontents) +PRVM_DECLARE_clientglobalfloat(trace_fraction) +PRVM_DECLARE_clientglobalfloat(trace_inopen) +PRVM_DECLARE_clientglobalfloat(trace_inwater) +PRVM_DECLARE_clientglobalfloat(trace_networkentity) +PRVM_DECLARE_clientglobalfloat(trace_plane_dist) +PRVM_DECLARE_clientglobalfloat(trace_startsolid) +PRVM_DECLARE_clientglobalfloat(transparent_offset) +PRVM_DECLARE_clientglobalstring(gettaginfo_name) +PRVM_DECLARE_clientglobalstring(mapname) +PRVM_DECLARE_clientglobalstring(trace_dphittexturename) +PRVM_DECLARE_clientglobalvector(dmg_origin) +PRVM_DECLARE_clientglobalvector(drawfontscale) +PRVM_DECLARE_clientglobalvector(gettaginfo_forward) +PRVM_DECLARE_clientglobalvector(gettaginfo_offset) +PRVM_DECLARE_clientglobalvector(gettaginfo_right) +PRVM_DECLARE_clientglobalvector(gettaginfo_up) +PRVM_DECLARE_clientglobalvector(input_angles) +PRVM_DECLARE_clientglobalvector(input_movevalues) +PRVM_DECLARE_clientglobalvector(particle_color1) +PRVM_DECLARE_clientglobalvector(particle_color2) +PRVM_DECLARE_clientglobalvector(particle_staincolor1) +PRVM_DECLARE_clientglobalvector(particle_staincolor2) +PRVM_DECLARE_clientglobalvector(particles_colormax) +PRVM_DECLARE_clientglobalvector(particles_colormin) +PRVM_DECLARE_clientglobalvector(pmove_inwater) +PRVM_DECLARE_clientglobalvector(pmove_maxs) +PRVM_DECLARE_clientglobalvector(pmove_mins) +PRVM_DECLARE_clientglobalvector(pmove_onground) +PRVM_DECLARE_clientglobalvector(pmove_org) +PRVM_DECLARE_clientglobalvector(pmove_vel) +PRVM_DECLARE_clientglobalvector(trace_endpos) +PRVM_DECLARE_clientglobalvector(trace_plane_normal) +PRVM_DECLARE_clientglobalvector(v_forward) +PRVM_DECLARE_clientglobalvector(v_right) +PRVM_DECLARE_clientglobalvector(v_up) +PRVM_DECLARE_clientglobalvector(view_angles) +PRVM_DECLARE_clientglobalvector(view_punchangle) +PRVM_DECLARE_clientglobalvector(view_punchvector) +PRVM_DECLARE_field(SendEntity) +PRVM_DECLARE_field(SendFlags) +PRVM_DECLARE_field(Version) +PRVM_DECLARE_field(absmax) +PRVM_DECLARE_field(absmin) +PRVM_DECLARE_field(aiment) +PRVM_DECLARE_field(alpha) +PRVM_DECLARE_field(ammo_cells) +PRVM_DECLARE_field(ammo_cells1) +PRVM_DECLARE_field(ammo_lava_nails) +PRVM_DECLARE_field(ammo_multi_rockets) +PRVM_DECLARE_field(ammo_nails) +PRVM_DECLARE_field(ammo_nails1) +PRVM_DECLARE_field(ammo_plasma) +PRVM_DECLARE_field(ammo_rockets) +PRVM_DECLARE_field(ammo_rockets1) +PRVM_DECLARE_field(ammo_shells) +PRVM_DECLARE_field(ammo_shells1) +PRVM_DECLARE_field(angles) +PRVM_DECLARE_field(armortype) +PRVM_DECLARE_field(armorvalue) +PRVM_DECLARE_field(avelocity) +PRVM_DECLARE_field(blocked) +PRVM_DECLARE_field(bouncefactor) +PRVM_DECLARE_field(bouncestop) +PRVM_DECLARE_field(button0) +PRVM_DECLARE_field(button1) +PRVM_DECLARE_field(button2) +PRVM_DECLARE_field(button3) +PRVM_DECLARE_field(button4) +PRVM_DECLARE_field(button5) +PRVM_DECLARE_field(button6) +PRVM_DECLARE_field(button7) +PRVM_DECLARE_field(button8) +PRVM_DECLARE_field(button9) +PRVM_DECLARE_field(button10) +PRVM_DECLARE_field(button11) +PRVM_DECLARE_field(button12) +PRVM_DECLARE_field(button13) +PRVM_DECLARE_field(button14) +PRVM_DECLARE_field(button15) +PRVM_DECLARE_field(button16) +PRVM_DECLARE_field(buttonchat) +PRVM_DECLARE_field(buttonuse) +PRVM_DECLARE_field(camera_transform) +PRVM_DECLARE_field(chain) +PRVM_DECLARE_field(classname) +PRVM_DECLARE_field(clientcamera) +PRVM_DECLARE_field(clientcolors) +PRVM_DECLARE_field(clientstatus) +PRVM_DECLARE_field(color) +PRVM_DECLARE_field(colormap) +PRVM_DECLARE_field(colormod) +PRVM_DECLARE_field(contentstransition) +PRVM_DECLARE_field(crypto_encryptmethod) +PRVM_DECLARE_field(crypto_idfp) +PRVM_DECLARE_field(crypto_keyfp) +PRVM_DECLARE_field(crypto_mykeyfp) +PRVM_DECLARE_field(crypto_signmethod) +PRVM_DECLARE_field(currentammo) +PRVM_DECLARE_field(cursor_active) +PRVM_DECLARE_field(cursor_screen) +PRVM_DECLARE_field(cursor_trace_endpos) +PRVM_DECLARE_field(cursor_trace_ent) +PRVM_DECLARE_field(cursor_trace_start) +PRVM_DECLARE_field(customizeentityforclient) +PRVM_DECLARE_field(deadflag) +PRVM_DECLARE_field(disableclientprediction) +PRVM_DECLARE_field(discardabledemo) +PRVM_DECLARE_field(dmg_inflictor) +PRVM_DECLARE_field(dmg_save) +PRVM_DECLARE_field(dmg_take) +PRVM_DECLARE_field(dphitcontentsmask) +PRVM_DECLARE_field(drawmask) +PRVM_DECLARE_field(drawonlytoclient) +PRVM_DECLARE_field(effects) +PRVM_DECLARE_field(enemy) +PRVM_DECLARE_field(entnum) +PRVM_DECLARE_field(exteriormodeltoclient) +PRVM_DECLARE_field(fixangle) +PRVM_DECLARE_field(flags) +PRVM_DECLARE_field(frags) +PRVM_DECLARE_field(frame) +PRVM_DECLARE_field(frame1time) +PRVM_DECLARE_field(frame2) +PRVM_DECLARE_field(frame2time) +PRVM_DECLARE_field(frame3) +PRVM_DECLARE_field(frame3time) +PRVM_DECLARE_field(frame4) +PRVM_DECLARE_field(frame4time) +PRVM_DECLARE_field(fullbright) +PRVM_DECLARE_field(glow_color) +PRVM_DECLARE_field(glow_size) +PRVM_DECLARE_field(glow_trail) +PRVM_DECLARE_field(glowmod) +PRVM_DECLARE_field(goalentity) +PRVM_DECLARE_field(gravity) +PRVM_DECLARE_field(groundentity) +PRVM_DECLARE_field(health) +PRVM_DECLARE_field(ideal_yaw) +PRVM_DECLARE_field(idealpitch) +PRVM_DECLARE_field(impulse) +PRVM_DECLARE_field(items) +PRVM_DECLARE_field(items2) +PRVM_DECLARE_field(jointtype) +PRVM_DECLARE_field(lerpfrac) +PRVM_DECLARE_field(lerpfrac3) +PRVM_DECLARE_field(lerpfrac4) +PRVM_DECLARE_field(light_lev) +PRVM_DECLARE_field(ltime) +PRVM_DECLARE_field(mass) +PRVM_DECLARE_field(max_health) +PRVM_DECLARE_field(maxs) +PRVM_DECLARE_field(message) +PRVM_DECLARE_field(mins) +PRVM_DECLARE_field(model) +PRVM_DECLARE_field(modelflags) +PRVM_DECLARE_field(modelindex) +PRVM_DECLARE_field(movedir) +PRVM_DECLARE_field(movement) +PRVM_DECLARE_field(movetype) +PRVM_DECLARE_field(movetypesteplandevent) +PRVM_DECLARE_field(netaddress) +PRVM_DECLARE_field(netname) +PRVM_DECLARE_field(nextthink) +PRVM_DECLARE_field(nodrawtoclient) +PRVM_DECLARE_field(noise) +PRVM_DECLARE_field(noise1) +PRVM_DECLARE_field(noise2) +PRVM_DECLARE_field(noise3) +PRVM_DECLARE_field(oldorigin) +PRVM_DECLARE_field(origin) +PRVM_DECLARE_field(owner) +PRVM_DECLARE_field(pflags) +PRVM_DECLARE_field(ping) +PRVM_DECLARE_field(ping_movementloss) +PRVM_DECLARE_field(ping_packetloss) +PRVM_DECLARE_field(pitch_speed) +PRVM_DECLARE_field(playermodel) +PRVM_DECLARE_field(playerskin) +PRVM_DECLARE_field(pmodel) +PRVM_DECLARE_field(predraw) +PRVM_DECLARE_field(punchangle) +PRVM_DECLARE_field(punchvector) +PRVM_DECLARE_field(renderamt) +PRVM_DECLARE_field(renderflags) +PRVM_DECLARE_field(scale) +PRVM_DECLARE_field(sendcomplexanimation) +PRVM_DECLARE_field(shadertime) +PRVM_DECLARE_field(size) +PRVM_DECLARE_field(skeletonindex) +PRVM_DECLARE_field(skin) +PRVM_DECLARE_field(solid) +PRVM_DECLARE_field(sounds) +PRVM_DECLARE_field(spawnflags) +PRVM_DECLARE_field(style) +PRVM_DECLARE_field(tag_entity) +PRVM_DECLARE_field(tag_index) +PRVM_DECLARE_field(takedamage) +PRVM_DECLARE_field(target) +PRVM_DECLARE_field(targetname) +PRVM_DECLARE_field(team) +PRVM_DECLARE_field(teleport_time) +PRVM_DECLARE_field(think) +PRVM_DECLARE_field(touch) +PRVM_DECLARE_field(use) +PRVM_DECLARE_field(userwavefunc_param0) +PRVM_DECLARE_field(userwavefunc_param1) +PRVM_DECLARE_field(userwavefunc_param2) +PRVM_DECLARE_field(userwavefunc_param3) +PRVM_DECLARE_field(v_angle) +PRVM_DECLARE_field(velocity) +PRVM_DECLARE_field(view_ofs) +PRVM_DECLARE_field(viewmodelforclient) +PRVM_DECLARE_field(viewzoom) +PRVM_DECLARE_field(waterlevel) +PRVM_DECLARE_field(watertype) +PRVM_DECLARE_field(weapon) +PRVM_DECLARE_field(weaponframe) +PRVM_DECLARE_field(weaponmodel) +PRVM_DECLARE_field(yaw_speed) +PRVM_DECLARE_function(CSQC_ConsoleCommand) +PRVM_DECLARE_function(CSQC_Ent_Remove) +PRVM_DECLARE_function(CSQC_Ent_Spawn) +PRVM_DECLARE_function(CSQC_Ent_Update) +PRVM_DECLARE_function(CSQC_Event) +PRVM_DECLARE_function(CSQC_Event_Sound) +PRVM_DECLARE_function(CSQC_Init) +PRVM_DECLARE_function(CSQC_InputEvent) +PRVM_DECLARE_function(CSQC_Parse_CenterPrint) +PRVM_DECLARE_function(CSQC_Parse_Print) +PRVM_DECLARE_function(CSQC_Parse_StuffCmd) +PRVM_DECLARE_function(CSQC_Parse_TempEntity) +PRVM_DECLARE_function(CSQC_Shutdown) +PRVM_DECLARE_function(CSQC_UpdateView) +PRVM_DECLARE_function(ClientConnect) +PRVM_DECLARE_function(ClientDisconnect) +PRVM_DECLARE_function(ClientKill) +PRVM_DECLARE_function(EndFrame) +PRVM_DECLARE_function(GameCommand) +PRVM_DECLARE_function(Gecko_Query) +PRVM_DECLARE_function(PlayerPostThink) +PRVM_DECLARE_function(PlayerPreThink) +PRVM_DECLARE_function(PutClientInServer) +PRVM_DECLARE_function(RestoreGame) +PRVM_DECLARE_function(SV_ChangeTeam) +PRVM_DECLARE_function(SV_OnEntityNoSpawnFunction) +PRVM_DECLARE_function(SV_OnEntityPostSpawnFunction) +PRVM_DECLARE_function(SV_OnEntityPreSpawnFunction) +PRVM_DECLARE_function(SV_ParseClientCommand) +PRVM_DECLARE_function(SV_PausedTic) +PRVM_DECLARE_function(SV_PlayerPhysics) +PRVM_DECLARE_function(SV_Shutdown) +PRVM_DECLARE_function(SetChangeParms) +PRVM_DECLARE_function(SetNewParms) +PRVM_DECLARE_function(StartFrame) +PRVM_DECLARE_function(URI_Get_Callback) +PRVM_DECLARE_function(m_draw) +PRVM_DECLARE_function(m_init) +PRVM_DECLARE_function(m_keydown) +PRVM_DECLARE_function(m_keyup) +PRVM_DECLARE_function(m_newmap) +PRVM_DECLARE_function(m_shutdown) +PRVM_DECLARE_function(m_toggle) +PRVM_DECLARE_function(main) +PRVM_DECLARE_global(SV_InitCmd) +PRVM_DECLARE_global(clientcommandframe) +PRVM_DECLARE_global(coop) +PRVM_DECLARE_global(deathmatch) +PRVM_DECLARE_global(dmg_origin) +PRVM_DECLARE_global(dmg_save) +PRVM_DECLARE_global(dmg_take) +PRVM_DECLARE_global(drawfont) +PRVM_DECLARE_global(drawfontscale) +PRVM_DECLARE_global(force_retouch) +PRVM_DECLARE_global(found_secrets) +PRVM_DECLARE_global(frametime) +PRVM_DECLARE_global(gettaginfo_forward) +PRVM_DECLARE_global(gettaginfo_name) +PRVM_DECLARE_global(gettaginfo_offset) +PRVM_DECLARE_global(gettaginfo_parent) +PRVM_DECLARE_global(gettaginfo_right) +PRVM_DECLARE_global(gettaginfo_up) +PRVM_DECLARE_global(input_angles) +PRVM_DECLARE_global(input_buttons) +PRVM_DECLARE_global(input_movevalues) +PRVM_DECLARE_global(input_timelength) +PRVM_DECLARE_global(intermission) +PRVM_DECLARE_global(killed_monsters) +PRVM_DECLARE_global(mapname) +PRVM_DECLARE_global(maxclients) +PRVM_DECLARE_global(movevar_accelerate) +PRVM_DECLARE_global(movevar_airaccelerate) +PRVM_DECLARE_global(movevar_entgravity) +PRVM_DECLARE_global(movevar_friction) +PRVM_DECLARE_global(movevar_gravity) +PRVM_DECLARE_global(movevar_maxspeed) +PRVM_DECLARE_global(movevar_spectatormaxspeed) +PRVM_DECLARE_global(movevar_stopspeed) +PRVM_DECLARE_global(movevar_wateraccelerate) +PRVM_DECLARE_global(movevar_waterfriction) +PRVM_DECLARE_global(msg_entity) +PRVM_DECLARE_global(other) +PRVM_DECLARE_global(parm1) +PRVM_DECLARE_global(parm2) +PRVM_DECLARE_global(parm3) +PRVM_DECLARE_global(parm4) +PRVM_DECLARE_global(parm5) +PRVM_DECLARE_global(parm6) +PRVM_DECLARE_global(parm7) +PRVM_DECLARE_global(parm8) +PRVM_DECLARE_global(parm9) +PRVM_DECLARE_global(parm10) +PRVM_DECLARE_global(parm11) +PRVM_DECLARE_global(parm12) +PRVM_DECLARE_global(parm13) +PRVM_DECLARE_global(parm14) +PRVM_DECLARE_global(parm15) +PRVM_DECLARE_global(parm16) +PRVM_DECLARE_global(particle_airfriction) +PRVM_DECLARE_global(particle_alpha) +PRVM_DECLARE_global(particle_alphafade) +PRVM_DECLARE_global(particle_angle) +PRVM_DECLARE_global(particle_blendmode) +PRVM_DECLARE_global(particle_bounce) +PRVM_DECLARE_global(particle_color1) +PRVM_DECLARE_global(particle_color2) +PRVM_DECLARE_global(particle_delaycollision) +PRVM_DECLARE_global(particle_delayspawn) +PRVM_DECLARE_global(particle_gravity) +PRVM_DECLARE_global(particle_liquidfriction) +PRVM_DECLARE_global(particle_orientation) +PRVM_DECLARE_global(particle_originjitter) +PRVM_DECLARE_global(particle_qualityreduction) +PRVM_DECLARE_global(particle_size) +PRVM_DECLARE_global(particle_sizeincrease) +PRVM_DECLARE_global(particle_spin) +PRVM_DECLARE_global(particle_stainalpha) +PRVM_DECLARE_global(particle_staincolor1) +PRVM_DECLARE_global(particle_staincolor2) +PRVM_DECLARE_global(particle_stainsize) +PRVM_DECLARE_global(particle_staintex) +PRVM_DECLARE_global(particle_stretch) +PRVM_DECLARE_global(particle_tex) +PRVM_DECLARE_global(particle_time) +PRVM_DECLARE_global(particle_type) +PRVM_DECLARE_global(particle_velocityjitter) +PRVM_DECLARE_global(particles_alphamax) +PRVM_DECLARE_global(particles_alphamin) +PRVM_DECLARE_global(particles_colormax) +PRVM_DECLARE_global(particles_colormin) +PRVM_DECLARE_global(player_localentnum) +PRVM_DECLARE_global(player_localnum) +PRVM_DECLARE_global(pmove_inwater) +PRVM_DECLARE_global(pmove_maxs) +PRVM_DECLARE_global(pmove_mins) +PRVM_DECLARE_global(pmove_onground) +PRVM_DECLARE_global(pmove_org) +PRVM_DECLARE_global(pmove_vel) +PRVM_DECLARE_global(require_spawnfunc_prefix) +PRVM_DECLARE_global(sb_showscores) +PRVM_DECLARE_global(self) +PRVM_DECLARE_global(servercommandframe) +PRVM_DECLARE_global(serverdeltatime) +PRVM_DECLARE_global(serverflags) +PRVM_DECLARE_global(serverprevtime) +PRVM_DECLARE_global(servertime) +PRVM_DECLARE_global(teamplay) +PRVM_DECLARE_global(time) +PRVM_DECLARE_global(total_monsters) +PRVM_DECLARE_global(total_secrets) +PRVM_DECLARE_global(trace_allsolid) +PRVM_DECLARE_global(trace_dphitcontents) +PRVM_DECLARE_global(trace_dphitq3surfaceflags) +PRVM_DECLARE_global(trace_dphittexturename) +PRVM_DECLARE_global(trace_dpstartcontents) +PRVM_DECLARE_global(trace_endpos) +PRVM_DECLARE_global(trace_ent) +PRVM_DECLARE_global(trace_fraction) +PRVM_DECLARE_global(trace_inopen) +PRVM_DECLARE_global(trace_inwater) +PRVM_DECLARE_global(trace_networkentity) +PRVM_DECLARE_global(trace_plane_dist) +PRVM_DECLARE_global(trace_plane_normal) +PRVM_DECLARE_global(trace_startsolid) +PRVM_DECLARE_global(transparent_offset) +PRVM_DECLARE_global(v_forward) +PRVM_DECLARE_global(v_right) +PRVM_DECLARE_global(v_up) +PRVM_DECLARE_global(view_angles) +PRVM_DECLARE_global(view_punchangle) +PRVM_DECLARE_global(view_punchvector) +PRVM_DECLARE_global(world) +PRVM_DECLARE_global(worldstatus) +PRVM_DECLARE_menufieldstring(classname) +PRVM_DECLARE_menufunction(GameCommand) +PRVM_DECLARE_menufunction(Gecko_Query) +PRVM_DECLARE_menufunction(URI_Get_Callback) +PRVM_DECLARE_menufunction(m_draw) +PRVM_DECLARE_menufunction(m_init) +PRVM_DECLARE_menufunction(m_keydown) +PRVM_DECLARE_menufunction(m_keyup) +PRVM_DECLARE_menufunction(m_newmap) +PRVM_DECLARE_menufunction(m_shutdown) +PRVM_DECLARE_menufunction(m_toggle) +PRVM_DECLARE_menuglobaledict(self) +PRVM_DECLARE_menuglobalfloat(drawfont) +PRVM_DECLARE_menuglobalfloat(require_spawnfunc_prefix) +PRVM_DECLARE_menuglobalvector(drawfontscale) +PRVM_DECLARE_serverfieldedict(aiment) +PRVM_DECLARE_serverfieldedict(chain) +PRVM_DECLARE_serverfieldedict(clientcamera) +PRVM_DECLARE_serverfieldedict(cursor_trace_ent) +PRVM_DECLARE_serverfieldedict(dmg_inflictor) +PRVM_DECLARE_serverfieldedict(drawonlytoclient) +PRVM_DECLARE_serverfieldedict(enemy) +PRVM_DECLARE_serverfieldedict(exteriormodeltoclient) +PRVM_DECLARE_serverfieldedict(goalentity) +PRVM_DECLARE_serverfieldedict(groundentity) +PRVM_DECLARE_serverfieldedict(nodrawtoclient) +PRVM_DECLARE_serverfieldedict(owner) +PRVM_DECLARE_serverfieldedict(tag_entity) +PRVM_DECLARE_serverfieldedict(viewmodelforclient) +PRVM_DECLARE_serverfieldfloat(SendFlags) +PRVM_DECLARE_serverfieldfloat(Version) +PRVM_DECLARE_serverfieldfloat(alpha) +PRVM_DECLARE_serverfieldfloat(ammo_cells) +PRVM_DECLARE_serverfieldfloat(ammo_cells1) +PRVM_DECLARE_serverfieldfloat(ammo_lava_nails) +PRVM_DECLARE_serverfieldfloat(ammo_multi_rockets) +PRVM_DECLARE_serverfieldfloat(ammo_nails) +PRVM_DECLARE_serverfieldfloat(ammo_nails1) +PRVM_DECLARE_serverfieldfloat(ammo_plasma) +PRVM_DECLARE_serverfieldfloat(ammo_rockets) +PRVM_DECLARE_serverfieldfloat(ammo_rockets1) +PRVM_DECLARE_serverfieldfloat(ammo_shells) +PRVM_DECLARE_serverfieldfloat(ammo_shells1) +PRVM_DECLARE_serverfieldfloat(armortype) +PRVM_DECLARE_serverfieldfloat(armorvalue) +PRVM_DECLARE_serverfieldfloat(bouncefactor) +PRVM_DECLARE_serverfieldfloat(bouncestop) +PRVM_DECLARE_serverfieldfloat(button0) +PRVM_DECLARE_serverfieldfloat(button1) +PRVM_DECLARE_serverfieldfloat(button2) +PRVM_DECLARE_serverfieldfloat(button3) +PRVM_DECLARE_serverfieldfloat(button4) +PRVM_DECLARE_serverfieldfloat(button5) +PRVM_DECLARE_serverfieldfloat(button6) +PRVM_DECLARE_serverfieldfloat(button7) +PRVM_DECLARE_serverfieldfloat(button8) +PRVM_DECLARE_serverfieldfloat(button9) +PRVM_DECLARE_serverfieldfloat(button10) +PRVM_DECLARE_serverfieldfloat(button11) +PRVM_DECLARE_serverfieldfloat(button12) +PRVM_DECLARE_serverfieldfloat(button13) +PRVM_DECLARE_serverfieldfloat(button14) +PRVM_DECLARE_serverfieldfloat(button15) +PRVM_DECLARE_serverfieldfloat(button16) +PRVM_DECLARE_serverfieldfloat(buttonchat) +PRVM_DECLARE_serverfieldfloat(buttonuse) +PRVM_DECLARE_serverfieldfloat(clientcolors) +PRVM_DECLARE_serverfieldfloat(colormap) +PRVM_DECLARE_serverfieldfloat(currentammo) +PRVM_DECLARE_serverfieldfloat(cursor_active) +PRVM_DECLARE_serverfieldfloat(deadflag) +PRVM_DECLARE_serverfieldfloat(disableclientprediction) +PRVM_DECLARE_serverfieldfloat(discardabledemo) +PRVM_DECLARE_serverfieldfloat(dmg_save) +PRVM_DECLARE_serverfieldfloat(dmg_take) +PRVM_DECLARE_serverfieldfloat(dphitcontentsmask) +PRVM_DECLARE_serverfieldfloat(effects) +PRVM_DECLARE_serverfieldfloat(fixangle) +PRVM_DECLARE_serverfieldfloat(flags) +PRVM_DECLARE_serverfieldfloat(frags) +PRVM_DECLARE_serverfieldfloat(frame) +PRVM_DECLARE_serverfieldfloat(frame1time) +PRVM_DECLARE_serverfieldfloat(frame2) +PRVM_DECLARE_serverfieldfloat(frame2time) +PRVM_DECLARE_serverfieldfloat(frame3) +PRVM_DECLARE_serverfieldfloat(frame3time) +PRVM_DECLARE_serverfieldfloat(frame4) +PRVM_DECLARE_serverfieldfloat(frame4time) +PRVM_DECLARE_serverfieldfloat(fullbright) +PRVM_DECLARE_serverfieldfloat(glow_color) +PRVM_DECLARE_serverfieldfloat(glow_size) +PRVM_DECLARE_serverfieldfloat(glow_trail) +PRVM_DECLARE_serverfieldfloat(gravity) +PRVM_DECLARE_serverfieldfloat(health) +PRVM_DECLARE_serverfieldfloat(ideal_yaw) +PRVM_DECLARE_serverfieldfloat(idealpitch) +PRVM_DECLARE_serverfieldfloat(impulse) +PRVM_DECLARE_serverfieldfloat(items) +PRVM_DECLARE_serverfieldfloat(items2) +PRVM_DECLARE_serverfieldfloat(jointtype) +PRVM_DECLARE_serverfieldfloat(lerpfrac) +PRVM_DECLARE_serverfieldfloat(lerpfrac3) +PRVM_DECLARE_serverfieldfloat(lerpfrac4) +PRVM_DECLARE_serverfieldfloat(light_lev) +PRVM_DECLARE_serverfieldfloat(ltime) +PRVM_DECLARE_serverfieldfloat(mass) +PRVM_DECLARE_serverfieldfloat(max_health) +PRVM_DECLARE_serverfieldfloat(modelflags) +PRVM_DECLARE_serverfieldfloat(modelindex) +PRVM_DECLARE_serverfieldfloat(movetype) +PRVM_DECLARE_serverfieldfloat(nextthink) +PRVM_DECLARE_serverfieldfloat(pflags) +PRVM_DECLARE_serverfieldfloat(ping) +PRVM_DECLARE_serverfieldfloat(ping_movementloss) +PRVM_DECLARE_serverfieldfloat(ping_packetloss) +PRVM_DECLARE_serverfieldfloat(pitch_speed) +PRVM_DECLARE_serverfieldfloat(pmodel) +PRVM_DECLARE_serverfieldfloat(renderamt) +PRVM_DECLARE_serverfieldfloat(scale) +PRVM_DECLARE_serverfieldfloat(sendcomplexanimation) +PRVM_DECLARE_serverfieldfloat(skeletonindex) +PRVM_DECLARE_serverfieldfloat(skin) +PRVM_DECLARE_serverfieldfloat(solid) +PRVM_DECLARE_serverfieldfloat(sounds) +PRVM_DECLARE_serverfieldfloat(spawnflags) +PRVM_DECLARE_serverfieldfloat(style) +PRVM_DECLARE_serverfieldfloat(tag_index) +PRVM_DECLARE_serverfieldfloat(takedamage) +PRVM_DECLARE_serverfieldfloat(team) +PRVM_DECLARE_serverfieldfloat(teleport_time) +PRVM_DECLARE_serverfieldfloat(viewzoom) +PRVM_DECLARE_serverfieldfloat(waterlevel) +PRVM_DECLARE_serverfieldfloat(watertype) +PRVM_DECLARE_serverfieldfloat(weapon) +PRVM_DECLARE_serverfieldfloat(weaponframe) +PRVM_DECLARE_serverfieldfloat(yaw_speed) +PRVM_DECLARE_serverfieldfunction(SendEntity) +PRVM_DECLARE_serverfieldfunction(blocked) +PRVM_DECLARE_serverfieldfunction(camera_transform) +PRVM_DECLARE_serverfieldfunction(contentstransition) +PRVM_DECLARE_serverfieldfunction(customizeentityforclient) +PRVM_DECLARE_serverfieldfunction(movetypesteplandevent) +PRVM_DECLARE_serverfieldfunction(think) +PRVM_DECLARE_serverfieldfunction(touch) +PRVM_DECLARE_serverfieldfunction(use) +PRVM_DECLARE_serverfieldstring(classname) +PRVM_DECLARE_serverfieldstring(clientstatus) +PRVM_DECLARE_serverfieldstring(crypto_encryptmethod) +PRVM_DECLARE_serverfieldstring(crypto_idfp) +PRVM_DECLARE_serverfieldstring(crypto_keyfp) +PRVM_DECLARE_serverfieldstring(crypto_mykeyfp) +PRVM_DECLARE_serverfieldstring(crypto_signmethod) +PRVM_DECLARE_serverfieldstring(message) +PRVM_DECLARE_serverfieldstring(model) +PRVM_DECLARE_serverfieldstring(netaddress) +PRVM_DECLARE_serverfieldstring(netname) +PRVM_DECLARE_serverfieldstring(noise) +PRVM_DECLARE_serverfieldstring(noise1) +PRVM_DECLARE_serverfieldstring(noise2) +PRVM_DECLARE_serverfieldstring(noise3) +PRVM_DECLARE_serverfieldstring(playermodel) +PRVM_DECLARE_serverfieldstring(playerskin) +PRVM_DECLARE_serverfieldstring(target) +PRVM_DECLARE_serverfieldstring(targetname) +PRVM_DECLARE_serverfieldstring(weaponmodel) +PRVM_DECLARE_serverfieldvector(absmax) +PRVM_DECLARE_serverfieldvector(absmin) +PRVM_DECLARE_serverfieldvector(angles) +PRVM_DECLARE_serverfieldvector(avelocity) +PRVM_DECLARE_serverfieldvector(color) +PRVM_DECLARE_serverfieldvector(colormod) +PRVM_DECLARE_serverfieldvector(cursor_screen) +PRVM_DECLARE_serverfieldvector(cursor_trace_endpos) +PRVM_DECLARE_serverfieldvector(cursor_trace_start) +PRVM_DECLARE_serverfieldvector(glowmod) +PRVM_DECLARE_serverfieldvector(maxs) +PRVM_DECLARE_serverfieldvector(mins) +PRVM_DECLARE_serverfieldvector(movedir) +PRVM_DECLARE_serverfieldvector(movement) +PRVM_DECLARE_serverfieldvector(oldorigin) +PRVM_DECLARE_serverfieldvector(origin) +PRVM_DECLARE_serverfieldvector(punchangle) +PRVM_DECLARE_serverfieldvector(punchvector) +PRVM_DECLARE_serverfieldvector(size) +PRVM_DECLARE_serverfieldvector(v_angle) +PRVM_DECLARE_serverfieldvector(velocity) +PRVM_DECLARE_serverfieldvector(view_ofs) +PRVM_DECLARE_serverfunction(ClientConnect) +PRVM_DECLARE_serverfunction(ClientDisconnect) +PRVM_DECLARE_serverfunction(ClientKill) +PRVM_DECLARE_serverfunction(EndFrame) +PRVM_DECLARE_serverfunction(GameCommand) +PRVM_DECLARE_serverfunction(PlayerPostThink) +PRVM_DECLARE_serverfunction(PlayerPreThink) +PRVM_DECLARE_serverfunction(PutClientInServer) +PRVM_DECLARE_serverfunction(RestoreGame) +PRVM_DECLARE_serverfunction(SV_ChangeTeam) +PRVM_DECLARE_serverfunction(SV_OnEntityNoSpawnFunction) +PRVM_DECLARE_serverfunction(SV_OnEntityPostSpawnFunction) +PRVM_DECLARE_serverfunction(SV_OnEntityPreSpawnFunction) +PRVM_DECLARE_serverfunction(SV_ParseClientCommand) +PRVM_DECLARE_serverfunction(SV_PausedTic) +PRVM_DECLARE_serverfunction(SV_PlayerPhysics) +PRVM_DECLARE_serverfunction(SV_Shutdown) +PRVM_DECLARE_serverfunction(SetChangeParms) +PRVM_DECLARE_serverfunction(SetNewParms) +PRVM_DECLARE_serverfunction(StartFrame) +PRVM_DECLARE_serverfunction(URI_Get_Callback) +PRVM_DECLARE_serverfunction(main) +PRVM_DECLARE_serverglobaledict(msg_entity) +PRVM_DECLARE_serverglobaledict(other) +PRVM_DECLARE_serverglobaledict(self) +PRVM_DECLARE_serverglobaledict(trace_ent) +PRVM_DECLARE_serverglobaledict(world) +PRVM_DECLARE_serverglobalfloat(coop) +PRVM_DECLARE_serverglobalfloat(deathmatch) +PRVM_DECLARE_serverglobalfloat(force_retouch) +PRVM_DECLARE_serverglobalfloat(found_secrets) +PRVM_DECLARE_serverglobalfloat(frametime) +PRVM_DECLARE_serverglobalfloat(gettaginfo_parent) +PRVM_DECLARE_serverglobalfloat(killed_monsters) +PRVM_DECLARE_serverglobalfloat(parm1) +PRVM_DECLARE_serverglobalfloat(parm2) +PRVM_DECLARE_serverglobalfloat(parm3) +PRVM_DECLARE_serverglobalfloat(parm4) +PRVM_DECLARE_serverglobalfloat(parm5) +PRVM_DECLARE_serverglobalfloat(parm6) +PRVM_DECLARE_serverglobalfloat(parm7) +PRVM_DECLARE_serverglobalfloat(parm8) +PRVM_DECLARE_serverglobalfloat(parm9) +PRVM_DECLARE_serverglobalfloat(parm10) +PRVM_DECLARE_serverglobalfloat(parm11) +PRVM_DECLARE_serverglobalfloat(parm12) +PRVM_DECLARE_serverglobalfloat(parm13) +PRVM_DECLARE_serverglobalfloat(parm14) +PRVM_DECLARE_serverglobalfloat(parm15) +PRVM_DECLARE_serverglobalfloat(parm16) +PRVM_DECLARE_serverglobalfloat(require_spawnfunc_prefix) +PRVM_DECLARE_serverglobalfloat(serverflags) +PRVM_DECLARE_serverglobalfloat(teamplay) +PRVM_DECLARE_serverglobalfloat(time) +PRVM_DECLARE_serverglobalfloat(total_monsters) +PRVM_DECLARE_serverglobalfloat(total_secrets) +PRVM_DECLARE_serverglobalfloat(trace_allsolid) +PRVM_DECLARE_serverglobalfloat(trace_dphitcontents) +PRVM_DECLARE_serverglobalfloat(trace_dphitq3surfaceflags) +PRVM_DECLARE_serverglobalfloat(trace_dpstartcontents) +PRVM_DECLARE_serverglobalfloat(trace_fraction) +PRVM_DECLARE_serverglobalfloat(trace_inopen) +PRVM_DECLARE_serverglobalfloat(trace_inwater) +PRVM_DECLARE_serverglobalfloat(trace_plane_dist) +PRVM_DECLARE_serverglobalfloat(trace_startsolid) +PRVM_DECLARE_serverglobalstring(SV_InitCmd) +PRVM_DECLARE_serverglobalstring(gettaginfo_name) +PRVM_DECLARE_serverglobalstring(mapname) +PRVM_DECLARE_serverglobalstring(trace_dphittexturename) +PRVM_DECLARE_serverglobalstring(worldstatus) +PRVM_DECLARE_serverglobalvector(gettaginfo_forward) +PRVM_DECLARE_serverglobalvector(gettaginfo_offset) +PRVM_DECLARE_serverglobalvector(gettaginfo_right) +PRVM_DECLARE_serverglobalvector(gettaginfo_up) +PRVM_DECLARE_serverglobalvector(trace_endpos) +PRVM_DECLARE_serverglobalvector(trace_plane_normal) +PRVM_DECLARE_serverglobalvector(v_forward) +PRVM_DECLARE_serverglobalvector(v_right) +PRVM_DECLARE_serverglobalvector(v_up) \ No newline at end of file diff --git a/sv_main.c b/sv_main.c index 95b15596..0166241b 100644 --- a/sv_main.c +++ b/sv_main.c @@ -249,163 +249,158 @@ static const char *standardeffectnames[EFFECT_TOTAL] = prvm_required_field_t sv_reqfields[] = { - {ev_entity, "aiment"}, // server field - {ev_entity, "clientcamera"}, // server field - {ev_entity, "cursor_trace_ent"}, // server field - {ev_entity, "drawonlytoclient"}, // server field - {ev_entity, "enemy"}, // server field - {ev_entity, "exteriormodeltoclient"}, // server field - {ev_entity, "nodrawtoclient"}, // server field - {ev_entity, "tag_entity"}, // server field - {ev_entity, "viewmodelforclient"}, // server field - {ev_float, "SendFlags"}, // server field - {ev_float, "Version"}, // server field - {ev_float, "alpha"}, // server field - {ev_float, "ammo_cells1"}, // server field - {ev_float, "ammo_lava_nails"}, // server field - {ev_float, "ammo_multi_rockets"}, // server field - {ev_float, "ammo_nails1"}, // server field - {ev_float, "ammo_plasma"}, // server field - {ev_float, "ammo_rockets1"}, // server field - {ev_float, "ammo_shells1"}, // server field - {ev_float, "bouncefactor"}, // server field - {ev_float, "bouncestop"}, // server field - {ev_float, "button3"}, // server field - {ev_float, "button4"}, // server field - {ev_float, "button5"}, // server field - {ev_float, "button6"}, // server field - {ev_float, "button7"}, // server field - {ev_float, "button8"}, // server field - {ev_float, "button9"}, // server field - {ev_float, "button10"}, // server field - {ev_float, "button11"}, // server field - {ev_float, "button12"}, // server field - {ev_float, "button13"}, // server field - {ev_float, "button14"}, // server field - {ev_float, "button15"}, // server field - {ev_float, "button16"}, // server field - {ev_float, "buttonchat"}, // server field - {ev_float, "buttonuse"}, // server field - {ev_float, "clientcolors"}, // server field - {ev_float, "cursor_active"}, // server field - {ev_float, "disableclientprediction"}, // server field - {ev_float, "discardabledemo"}, // server field - {ev_float, "dphitcontentsmask"}, // server field - {ev_float, "frame1time"}, // server field - {ev_float, "frame1time"}, // server field - {ev_float, "frame2time"}, // server field - {ev_float, "frame2time"}, // server field - {ev_float, "frame2"}, // server field - {ev_float, "frame2"}, // server field - {ev_float, "frame3time"}, // server field - {ev_float, "frame3time"}, // server field - {ev_float, "frame3"}, // server field - {ev_float, "frame3"}, // server field - {ev_float, "frame4time"}, // server field - {ev_float, "frame4time"}, // server field - {ev_float, "frame4"}, // server field - {ev_float, "frame4"}, // server field - {ev_float, "frame"}, // server field - {ev_float, "fullbright"}, // server field - {ev_float, "glow_color"}, // server field - {ev_float, "glow_size"}, // server field - {ev_float, "glow_trail"}, // server field - {ev_float, "gravity"}, // server field - {ev_float, "gravity"}, // server field - {ev_float, "ideal_yaw"}, // server field - {ev_float, "idealpitch"}, // server field - {ev_float, "items2"}, // server field - {ev_float, "jointtype"}, // server field - {ev_float, "lerpfrac3"}, // server field - {ev_float, "lerpfrac3"}, // server field - {ev_float, "lerpfrac4"}, // server field - {ev_float, "lerpfrac4"}, // server field - {ev_float, "lerpfrac"}, // server field - {ev_float, "lerpfrac"}, // server field - {ev_float, "light_lev"}, // server field - {ev_float, "mass"}, // server field - {ev_float, "modelflags"}, // server field - {ev_float, "modelindex"}, // server field - {ev_float, "movetype"}, // server field - {ev_float, "pflags"}, // server field - {ev_float, "ping_movementloss"}, // server field - {ev_float, "ping_packetloss"}, // server field - {ev_float, "ping"}, // server field - {ev_float, "pitch_speed"}, // server field - {ev_float, "pmodel"}, // server field - {ev_float, "renderamt"}, // server field - {ev_float, "scale"}, // server field - {ev_float, "scale"}, // server field - {ev_float, "sendcomplexanimation"}, // server field - {ev_float, "skeletonindex"}, // server field - {ev_float, "skeletonindex"}, // server field - {ev_float, "solid"}, // server field - {ev_float, "style"}, // server field - {ev_float, "tag_index"}, // server field - {ev_float, "viewzoom"}, // server field - {ev_float, "yaw_speed"}, // server field - {ev_function, "SendEntity"}, // server field - {ev_function, "camera_transform"}, // server field - {ev_function, "contentstransition"}, // server field - {ev_function, "customizeentityforclient"}, // server field - {ev_function, "movetypesteplandevent"}, // server field - {ev_string, "classname"}, // server field - {ev_string, "clientstatus"}, // server field - {ev_string, "crypto_encryptmethod"}, // server field - {ev_string, "crypto_idfp"}, // server field - {ev_string, "crypto_keyfp"}, // server field - {ev_string, "crypto_mykeyfp"}, // server field - {ev_string, "crypto_signmethod"}, // server field - {ev_string, "netaddress"}, // server field - {ev_string, "playermodel"}, // server field - {ev_string, "playerskin"}, // server field - {ev_vector, "angles"}, // server field - {ev_vector, "avelocity"}, // server field - {ev_vector, "colormod"}, // server field - {ev_vector, "color"}, // server field - {ev_vector, "cursor_screen"}, // server field - {ev_vector, "cursor_trace_endpos"}, // server field - {ev_vector, "cursor_trace_start"}, // server field - {ev_vector, "glowmod"}, // server field - {ev_vector, "maxs"}, // server field - {ev_vector, "mins"}, // server field - {ev_vector, "movedir"}, // server field - {ev_vector, "movement"}, // server field - {ev_vector, "origin"}, // server field - {ev_vector, "punchvector"}, // server field - {ev_vector, "velocity"}, // server field +#define PRVM_DECLARE_serverglobalfloat(x) +#define PRVM_DECLARE_serverglobalvector(x) +#define PRVM_DECLARE_serverglobalstring(x) +#define PRVM_DECLARE_serverglobaledict(x) +#define PRVM_DECLARE_serverglobalfunction(x) +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) {ev_float, #x}, +#define PRVM_DECLARE_serverfieldvector(x) {ev_vector, #x}, +#define PRVM_DECLARE_serverfieldstring(x) {ev_string, #x}, +#define PRVM_DECLARE_serverfieldedict(x) {ev_entity, #x}, +#define PRVM_DECLARE_serverfieldfunction(x) {ev_function, #x}, +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; #define SV_REQGLOBALS (sizeof(sv_reqglobals) / sizeof(prvm_required_field_t)) prvm_required_field_t sv_reqglobals[] = { - {ev_entity, "self"}, // server global - {ev_entity, "trace_ent"}, // server global - {ev_float, "gettaginfo_parent"}, // server global - {ev_float, "require_spawnfunc_prefix"}, // server global - {ev_float, "trace_allsolid"}, // server global - {ev_float, "trace_dphitcontents"}, // server global - {ev_float, "trace_dphitq3surfaceflags"}, // server global - {ev_float, "trace_dpstartcontents"}, // server global - {ev_float, "trace_fraction"}, // server global - {ev_float, "trace_inopen"}, // server global - {ev_float, "trace_inwater"}, // server global - {ev_float, "trace_plane_dist"}, // server global - {ev_float, "trace_startsolid"}, // server global - {ev_string, "SV_InitCmd"}, // server global - {ev_string, "gettaginfo_name"}, // server global - {ev_string, "trace_dphittexturename"}, // server global - {ev_string, "worldstatus"}, // server global - {ev_vector, "gettaginfo_forward"}, // server global - {ev_vector, "gettaginfo_offset"}, // server global - {ev_vector, "gettaginfo_right"}, // server global - {ev_vector, "gettaginfo_up"}, // server global - {ev_vector, "trace_endpos"}, // server global - {ev_vector, "trace_plane_normal"}, // server global - {ev_vector, "v_forward"}, // server global - {ev_vector, "v_right"}, // server global - {ev_vector, "v_up"}, // server global +#define PRVM_DECLARE_serverglobalfloat(x) {ev_float, #x}, +#define PRVM_DECLARE_serverglobalvector(x) {ev_vector, #x}, +#define PRVM_DECLARE_serverglobalstring(x) {ev_string, #x}, +#define PRVM_DECLARE_serverglobaledict(x) {ev_entity, #x}, +#define PRVM_DECLARE_serverglobalfunction(x) {ev_function, #x}, +#define PRVM_DECLARE_clientglobalfloat(x) +#define PRVM_DECLARE_clientglobalvector(x) +#define PRVM_DECLARE_clientglobalstring(x) +#define PRVM_DECLARE_clientglobaledict(x) +#define PRVM_DECLARE_clientglobalfunction(x) +#define PRVM_DECLARE_menuglobalfloat(x) +#define PRVM_DECLARE_menuglobalvector(x) +#define PRVM_DECLARE_menuglobalstring(x) +#define PRVM_DECLARE_menuglobaledict(x) +#define PRVM_DECLARE_menuglobalfunction(x) +#define PRVM_DECLARE_serverfieldfloat(x) +#define PRVM_DECLARE_serverfieldvector(x) +#define PRVM_DECLARE_serverfieldstring(x) +#define PRVM_DECLARE_serverfieldedict(x) +#define PRVM_DECLARE_serverfieldfunction(x) +#define PRVM_DECLARE_clientfieldfloat(x) +#define PRVM_DECLARE_clientfieldvector(x) +#define PRVM_DECLARE_clientfieldstring(x) +#define PRVM_DECLARE_clientfieldedict(x) +#define PRVM_DECLARE_clientfieldfunction(x) +#define PRVM_DECLARE_menufieldfloat(x) +#define PRVM_DECLARE_menufieldvector(x) +#define PRVM_DECLARE_menufieldstring(x) +#define PRVM_DECLARE_menufieldedict(x) +#define PRVM_DECLARE_menufieldfunction(x) +#define PRVM_DECLARE_serverfunction(x) +#define PRVM_DECLARE_clientfunction(x) +#define PRVM_DECLARE_menufunction(x) +#define PRVM_DECLARE_field(x) +#define PRVM_DECLARE_global(x) +#define PRVM_DECLARE_function(x) +#include "prvm_offsets.h" +#undef PRVM_DECLARE_serverglobalfloat +#undef PRVM_DECLARE_serverglobalvector +#undef PRVM_DECLARE_serverglobalstring +#undef PRVM_DECLARE_serverglobaledict +#undef PRVM_DECLARE_serverglobalfunction +#undef PRVM_DECLARE_clientglobalfloat +#undef PRVM_DECLARE_clientglobalvector +#undef PRVM_DECLARE_clientglobalstring +#undef PRVM_DECLARE_clientglobaledict +#undef PRVM_DECLARE_clientglobalfunction +#undef PRVM_DECLARE_menuglobalfloat +#undef PRVM_DECLARE_menuglobalvector +#undef PRVM_DECLARE_menuglobalstring +#undef PRVM_DECLARE_menuglobaledict +#undef PRVM_DECLARE_menuglobalfunction +#undef PRVM_DECLARE_serverfieldfloat +#undef PRVM_DECLARE_serverfieldvector +#undef PRVM_DECLARE_serverfieldstring +#undef PRVM_DECLARE_serverfieldedict +#undef PRVM_DECLARE_serverfieldfunction +#undef PRVM_DECLARE_clientfieldfloat +#undef PRVM_DECLARE_clientfieldvector +#undef PRVM_DECLARE_clientfieldstring +#undef PRVM_DECLARE_clientfieldedict +#undef PRVM_DECLARE_clientfieldfunction +#undef PRVM_DECLARE_menufieldfloat +#undef PRVM_DECLARE_menufieldvector +#undef PRVM_DECLARE_menufieldstring +#undef PRVM_DECLARE_menufieldedict +#undef PRVM_DECLARE_menufieldfunction +#undef PRVM_DECLARE_serverfunction +#undef PRVM_DECLARE_clientfunction +#undef PRVM_DECLARE_menufunction +#undef PRVM_DECLARE_field +#undef PRVM_DECLARE_global +#undef PRVM_DECLARE_function }; @@ -3168,10 +3163,10 @@ void SV_SpawnServer (const char *server) { SV_VM_Begin(); World_End(&sv.world); - if(prog->funcoffsets.SV_Shutdown) + if(PRVM_serverfunction(SV_Shutdown)) { - func_t s = prog->funcoffsets.SV_Shutdown; - prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again + func_t s = PRVM_serverfunction(SV_Shutdown); + PRVM_serverfunction(SV_Shutdown) = 0; // prevent it from getting called again PRVM_ExecuteProgram(s,"SV_Shutdown() required"); } SV_VM_End(); diff --git a/sv_phys.c b/sv_phys.c index c0f89c89..343b1dc9 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -2990,12 +2990,12 @@ void SV_Physics (void) prog->globals.server->force_retouch = max(0, prog->globals.server->force_retouch - 1); // LordHavoc: endframe support - if (prog->funcoffsets.EndFrame) + if (PRVM_serverfunction(EndFrame)) { prog->globals.server->self = PRVM_EDICT_TO_PROG(prog->edicts); prog->globals.server->other = PRVM_EDICT_TO_PROG(prog->edicts); prog->globals.server->time = sv.time; - PRVM_ExecuteProgram (prog->funcoffsets.EndFrame, "QC function EndFrame is missing"); + PRVM_ExecuteProgram (PRVM_serverfunction(EndFrame), "QC function EndFrame is missing"); } // decrement prog->num_edicts if the highest number entities died diff --git a/sv_user.c b/sv_user.c index d675990f..8dec4ecb 100644 --- a/sv_user.c +++ b/sv_user.c @@ -382,11 +382,11 @@ void SV_ClientThink (void) SV_CheckVelocity(host_client->edict); // LordHavoc: QuakeC replacement for SV_ClientThink (player movement) - if (prog->funcoffsets.SV_PlayerPhysics && sv_playerphysicsqc.integer) + if (PRVM_serverfunction(SV_PlayerPhysics) && sv_playerphysicsqc.integer) { prog->globals.server->time = sv.time; prog->globals.server->self = PRVM_EDICT_TO_PROG(host_client->edict); - PRVM_ExecuteProgram (prog->funcoffsets.SV_PlayerPhysics, "QC function SV_PlayerPhysics is missing"); + PRVM_ExecuteProgram (PRVM_serverfunction(SV_PlayerPhysics), "QC function SV_PlayerPhysics is missing"); SV_CheckVelocity(host_client->edict); return; } @@ -863,13 +863,13 @@ void SV_ReadClientMessage(void) || strncasecmp(s, "begin", 5) == 0 || strncasecmp(s, "prespawn", 8) == 0) Cmd_ExecuteString (s, src_client); - else if (prog->funcoffsets.SV_ParseClientCommand) + else if (PRVM_serverfunction(SV_ParseClientCommand)) { int restorevm_tempstringsbuf_cursize; restorevm_tempstringsbuf_cursize = vm_tempstringsbuf.cursize; PRVM_G_INT(OFS_PARM0) = PRVM_SetTempString(s); prog->globals.server->self = PRVM_EDICT_TO_PROG(host_client->edict); - PRVM_ExecuteProgram (prog->funcoffsets.SV_ParseClientCommand, "QC function SV_ParseClientCommand is missing"); + PRVM_ExecuteProgram (PRVM_serverfunction(SV_ParseClientCommand), "QC function SV_ParseClientCommand is missing"); vm_tempstringsbuf.cursize = restorevm_tempstringsbuf_cursize; } else diff --git a/svvm_cmds.c b/svvm_cmds.c index f2028c47..fc7fedde 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -3767,10 +3767,10 @@ void VM_SV_Cmd_Init(void) void VM_SV_Cmd_Reset(void) { World_End(&sv.world); - if(prog->funcoffsets.SV_Shutdown) + if(PRVM_serverfunction(SV_Shutdown)) { - func_t s = prog->funcoffsets.SV_Shutdown; - prog->funcoffsets.SV_Shutdown = 0; // prevent it from getting called again + func_t s = PRVM_serverfunction(SV_Shutdown); + PRVM_serverfunction(SV_Shutdown) = 0; // prevent it from getting called again PRVM_ExecuteProgram(s,"SV_Shutdown() required"); }