]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
removed vm_cl_extensions (now uses vm_sv_extensions)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 19 Feb 2007 00:10:39 +0000 (00:10 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 19 Feb 2007 00:10:39 +0000 (00:10 +0000)
cleaned up fieldoffsets/globaloffsets/funcoffsets fetching code (including removal of some duplicates) and sorted the contents of the structs to match the new order of the code

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6858 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
csprogs.c
progsvm.h
prvm_edict.c

index b0effc637d37691ed2e5ab7ef13175fb16cdedfd..21626ad48ec8e72062838ea02826443719c94d60 100644 (file)
 //4 feature darkplaces csqc: add builtin to clientside qc for reading triangles of model meshes (useful to orient a ui along a triangle of a model mesh)
 //4 feature darkplaces csqc: add builtins to clientside qc for gl calls
 
-//[515]: really need new list ?
-char *vm_cl_extensions =
-"BX_WAL_SUPPORT "
-"DP_CON_SET "
-"DP_CON_SETA "
-"DP_CON_STARTMAP "
-"DP_EF_ADDITIVE "
-"DP_EF_BLUE "
-"DP_EF_FLAME "
-"DP_EF_FULLBRIGHT "
-"DP_EF_NODEPTHTEST "
-"DP_EF_NODRAW "
-"DP_EF_NOSHADOW "
-"DP_EF_RED "
-"DP_EF_STARDUST "
-"DP_ENT_ALPHA "
-"DP_ENT_CUSTOMCOLORMAP "
-"DP_ENT_GLOW "
-"DP_ENT_SCALE "
-"DP_GFX_EXTERNALTEXTURES "
-"DP_GFX_EXTERNALTEXTURES_PERMAP "
-"DP_GFX_FOG "
-"DP_GFX_QUAKE3MODELTAGS "
-"DP_GFX_SKINFILES "
-"DP_GFX_SKYBOX "
-"DP_HALFLIFE_MAP "
-"DP_HALFLIFE_MAP_CVAR "
-"DP_HALFLIFE_SPRITE "
-"DP_INPUTBUTTONS "
-"DP_LITSPRITES "
-"DP_LITSUPPORT "
-"DP_MONSTERWALK "
-"DP_MOVETYPEBOUNCEMISSILE "
-"DP_MOVETYPEFOLLOW "
-"DP_QC_ASINACOSATANATAN2TAN "
-"DP_QC_CHANGEPITCH "
-"DP_QC_COPYENTITY "
-"DP_QC_CVAR_STRING "
-"DP_QC_ETOS "
-"DP_QC_FINDCHAIN "
-"DP_QC_FINDCHAINFLAGS "
-"DP_QC_FINDCHAINFLOAT "
-"DP_QC_FINDFLAGS "
-"DP_QC_FINDFLOAT "
-"DP_QC_FS_SEARCH " // Black: same as in the menu qc
-"DP_QC_GETLIGHT "
-"DP_QC_GETSURFACE "
-"DP_QC_GETTAGINFO "
-"DP_QC_MINMAXBOUND "
-"DP_QC_MULTIPLETEMPSTRINGS "
-"DP_QC_RANDOMVEC "
-"DP_QC_SINCOSSQRTPOW "
-//"DP_QC_STRINGBUFFERS "       //[515]: not needed ?
-"DP_QC_STRFTIME "
-"DP_QC_STRINGCOLORFUNCTIONS "
-"DP_QC_TRACEBOX "
-//"DP_QC_TRACETOSS "
-"DP_QC_TRACE_MOVETYPE_HITMODEL "
-"DP_QC_TRACE_MOVETYPE_WORLDONLY "
-"DP_QC_UNLIMITEDTEMPSTRINGS "
-"DP_QC_VECTORVECTORS "
-"DP_QUAKE2_MODEL "
-"DP_QUAKE2_SPRITE "
-"DP_QUAKE3_MAP "
-"DP_QUAKE3_MODEL "
-"DP_REGISTERCVAR "
-"DP_SND_DIRECTIONLESSATTNNONE "
-"DP_SND_FAKETRACKS "
-"DP_SND_OGGVORBIS "
-"DP_SND_STEREOWAV "
-"DP_SOLIDCORPSE "
-"DP_SPRITE32 "
-"DP_SV_EFFECT "
-"DP_SV_ROTATINGBMODEL "
-"DP_SV_SLOWMO "
-"DP_TE_BLOOD "
-"DP_TE_BLOODSHOWER "
-"DP_TE_CUSTOMFLASH "
-"DP_TE_EXPLOSIONRGB "
-"DP_TE_FLAMEJET "
-"DP_TE_PARTICLECUBE "
-"DP_TE_PARTICLERAIN "
-"DP_TE_PARTICLESNOW "
-"DP_TE_PLASMABURN "
-"DP_TE_QUADEFFECTS1 "
-"DP_TE_SMALLFLASH "
-"DP_TE_SPARK "
-"DP_TE_STANDARDEFFECTBUILTINS "
-"EXT_BITSHIFT "
-"EXT_CSQC "
-"FRIK_FILE "
-"KRIMZON_SV_PARSECLIENTCOMMAND "
-"NEH_CMD_PLAY2 "
-"NXQ_GFX_LETTERBOX "
-"PRYDON_CLIENTCURSOR "
-"TENEBRAE_GFX_DLIGHTS "
-"TW_SV_STEPCONTROL "
-"NEXUIZ_PLAYERMODEL "
-"NEXUIZ_PLAYERSKIN "
-;
-
 sfx_t *S_FindName(const char *name);
 void PF_registercvar (void);
 int Sbar_GetPlayer (int index);
index a9f78d5ec1c165645fc0d9bcdf939461c3d2b37c..28fc97311a1bb43b48c0c57c0ef36522ce3f440d 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -630,7 +630,7 @@ void CL_VM_Init (void)
        prog->limit_edicts = CL_MAX_EDICTS;
        prog->reserved_edicts = 0;
        prog->edictprivate_size = sizeof(edict_engineprivate_t);
-       prog->extensionstring = vm_cl_extensions;
+       prog->extensionstring = vm_sv_extensions;
        prog->builtins = vm_cl_builtins;
        prog->numbuiltins = vm_cl_numbuiltins;
        prog->begin_increase_edicts = CL_VM_CB_BeginIncreaseEdicts;
index 0626ec3b2edc59cf6d119728356746fb46a50fef..17cf73693d5fa6e8512d864b2ac9544e199741ce 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -120,14 +120,18 @@ typedef void (*prvm_builtin_t) (void);
 // NOTE: field offsets use -1 for NULL
 typedef struct prvm_prog_fieldoffsets_s
 {
-       int classname; // common
-       int chain; // common - used by find builtins
-       int think; // common - used by OP_STATE
-       int nextthink; // common - used by OP_STATE
-       int frame; // common - used by OP_STATE
+       // server and client use a lot of similar fields, so this is combined
+       int SendEntity; // ssqc
+       int Version; // ssqc
+       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 gravity; // ssqc
        int button3; // ssqc
        int button4; // ssqc
        int button5; // ssqc
@@ -142,96 +146,91 @@ typedef struct prvm_prog_fieldoffsets_s
        int button14; // ssqc
        int button15; // ssqc
        int button16; // ssqc
-       int buttonuse; // ssqc
        int buttonchat; // ssqc
+       int buttonuse; // ssqc
+       int chain; // common - used by find builtins
+       int classname; // common
+       int clientcolors; // 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 dphitcontentsmask; // ssqc / csqc
+       int drawonlytoclient; // ssqc
+       int effects; // ssqc / csqc
+       int exteriormodeltoclient; // ssqc
+       int fatness; // ssqc / csqc
+       int forceshader; // csqc
+       int frame1time; // csqc
+       int frame2; // csqc
+       int frame2time; // 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 glow_color; // ssqc
-       int items2; // ssqc
-       int scale; // ssqc / csqc
-       int alpha; // ssqc / csqc
-       int renderamt; // ssqc - HalfLife support
-       int rendermode; // ssqc - HalfLife support
-       int fullbright; // ssqc - Nehahra support
-       int ammo_shells1; // ssqc - Dissolution of Eternity mission pack
-       int ammo_nails1; // ssqc - Dissolution of Eternity mission pack
-       int ammo_lava_nails; // ssqc - Dissolution of Eternity mission pack
-       int ammo_rockets1; // ssqc - Dissolution of Eternity mission pack
-       int ammo_multi_rockets; // ssqc - Dissolution of Eternity mission pack
-       int ammo_cells1; // ssqc - Dissolution of Eternity mission pack
-       int ammo_plasma; // ssqc - Dissolution of Eternity mission pack
+       int gravity; // ssqc
+       int groundentity; // ssqc / csqc
+       int hull; // ssqc / csqc
        int ideal_yaw; // ssqc / csqc
-       int yaw_speed; // ssqc / csqc
        int idealpitch; // ssqc / csqc
-       int pitch_speed; // ssqc / csqc
-       int viewmodelforclient; // ssqc
+       int items2; // ssqc
+       int lerpfrac; // csqc
+       int light_lev; // ssqc
+       int movement; // ssqc
+       int nextthink; // common - used by OP_STATE
        int nodrawtoclient; // ssqc
-       int exteriormodeltoclient; // ssqc
-       int drawonlytoclient; // ssqc
+       int pflags; // ssqc
        int ping; // ssqc
-       int movement; // ssqc
+       int pitch_speed; // ssqc / csqc
+       int playermodel; // ssqc
+       int playerskin; // ssqc
        int pmodel; // ssqc
        int punchvector; // ssqc
-       int viewzoom; // ssqc
-       int clientcolors; // ssqc
-       int tag_entity; // ssqc
-       int tag_index; // ssqc
-       int light_lev; // ssqc
-       int color; // ssqc
+       int renderamt; // ssqc - HalfLife support
+       int renderflags; // csqc
+       int rendermode; // ssqc - HalfLife support
+       int scale; // ssqc / csqc
        int style; // ssqc
-       int pflags; // ssqc
-       int cursor_active; // ssqc
-       int cursor_screen; // ssqc
-       int cursor_trace_start; // ssqc
-       int cursor_trace_endpos; // ssqc
-       int cursor_trace_ent; // ssqc
-       int colormod; // ssqc / csqc
-       int playermodel; // ssqc
-       int playerskin; // ssqc
-       int SendEntity; // ssqc
-       int Version; // ssqc
-       int customizeentityforclient; // ssqc
-       int dphitcontentsmask; // ssqc
-       int contentstransition; // ssqc
-       //int fatness; // ssqc / csqc
-       //int dimension_hit; // ssqc / csqc
-       //int dimension_solid; // ssqc / csqc
-
-       // csqc
-       int frame2;
-       int frame1time;
-       int frame2time;
-       int lerpfrac;
-       int renderflags;
-       //int forceshader;
-       int groundentity;
-       //int hull;
-       int effects;
-       //int tag_entity;
-       //int tag_index;
-       //int dphitcontentsmask;
-
-       // mqc
+       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
 }
 prvm_prog_fieldoffsets_t;
 
 // NOTE: global offsets use -1 for NULL
 typedef struct prvm_prog_globaloffsets_s
 {
-       // common
-       int self;
-       int time;
-
-       // ssqc
-       int trace_dpstartcontents;
-       int trace_dphitcontents;
-       int trace_dphitq3surfaceflags;
-       int trace_dphittexturename;
-       int SV_InitCmd;
-
-       // csqc
-
-       // mqc
+       // 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 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_dphitcontents; // ssqc / csqc
+       int trace_dphitq3surfaceflags; // ssqc / csqc
+       int trace_dphittexturename; // ssqc / csqc
+       int trace_dpstartcontents; // ssqc / csqc
 }
 prvm_prog_globaloffsets_t;
 
@@ -239,40 +238,33 @@ prvm_prog_globaloffsets_t;
 // NOTE: function offsets use 0 for NULL
 typedef struct prvm_prog_funcoffsets_s
 {
-       // common
-
-       // ssqc
-       func_t SV_PlayerPhysics;
-       func_t SV_ParseClientCommand;
-       func_t SV_ChangeTeam;
-       func_t EndFrame;
-       func_t RestoreGame;
-
-       // csqc
-       func_t CSQC_Init;
-       func_t CSQC_InputEvent;
-       func_t CSQC_UpdateView;
-       func_t CSQC_ConsoleCommand;
-       func_t CSQC_Shutdown;
-       func_t CSQC_Parse_TempEntity; //[515]: very helpfull when you want to create your own particles/decals/etc for effects that already exist
-       func_t CSQC_Parse_StuffCmd;
-       func_t CSQC_Parse_Print;
-       func_t CSQC_Parse_CenterPrint;
-       func_t CSQC_Ent_Update;
-       func_t CSQC_Ent_Remove;
-       func_t CSQC_Event; //[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...
-
-       // mqc
-       func_t m_init;
-#ifdef NG_MENU
-       func_t m_display;
-       func_t m_hide;
-#endif
-       func_t m_keydown;
-       func_t m_keyup;
-       func_t m_draw;
-       func_t m_toggle;
-       func_t m_shutdown;
+       func_t CSQC_ConsoleCommand; // csqc
+       func_t CSQC_Ent_Remove; // csqc
+       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_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 EndFrame; // ssqc
+       func_t RestoreGame; // ssqc
+       func_t SV_ChangeTeam; // ssqc
+       func_t SV_ParseClientCommand; // ssqc
+       func_t SV_PlayerPhysics; // ssqc
+
+       // menu qc only uses some functions, nothing else
+       func_t m_display; // mqc
+       func_t m_draw; // mqc
+       func_t m_hide; // 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
 }
 prvm_prog_funcoffsets_t;
 
@@ -427,8 +419,7 @@ extern const int vm_sv_numbuiltins;
 extern const int vm_cl_numbuiltins;
 extern const int vm_m_numbuiltins;
 
-extern char * vm_sv_extensions;
-extern char * vm_cl_extensions;
+extern char * vm_sv_extensions; // client also uses this
 extern char * vm_m_extensions;
 
 void VM_SV_Cmd_Init(void);
index 595992f68eed739ca360601d850854a2a4e7e0c3..700dd8e5efec37fcfcf5426bfc83051f2e48cf7f 100644 (file)
@@ -1229,136 +1229,136 @@ void PRVM_FindOffsets(void)
        // functions use 0 for NULL
        memset(&prog->funcoffsets, 0, sizeof(prog->funcoffsets));
 
-       // common
-       prog->fieldoffsets.classname = PRVM_ED_FindFieldOffset("classname");
-       prog->fieldoffsets.chain = PRVM_ED_FindFieldOffset("chain");
-       prog->fieldoffsets.think = PRVM_ED_FindFieldOffset("think");
-       prog->fieldoffsets.nextthink = PRVM_ED_FindFieldOffset("nextthink");
-       prog->fieldoffsets.frame = PRVM_ED_FindFieldOffset("frame");
-       prog->fieldoffsets.angles = PRVM_ED_FindFieldOffset("angles");
-       prog->globaloffsets.self = PRVM_ED_FindGlobalOffset("self");
-       prog->globaloffsets.time = PRVM_ED_FindGlobalOffset("time");
-
-       // ssqc
-       prog->fieldoffsets.gravity = PRVM_ED_FindFieldOffset("gravity");
-       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.buttonuse = PRVM_ED_FindFieldOffset("buttonuse");
-       prog->fieldoffsets.buttonchat = PRVM_ED_FindFieldOffset("buttonchat");
-       prog->fieldoffsets.glow_size = PRVM_ED_FindFieldOffset("glow_size");
-       prog->fieldoffsets.glow_trail = PRVM_ED_FindFieldOffset("glow_trail");
-       prog->fieldoffsets.glow_color = PRVM_ED_FindFieldOffset("glow_color");
-       prog->fieldoffsets.items2 = PRVM_ED_FindFieldOffset("items2");
-       prog->fieldoffsets.scale = PRVM_ED_FindFieldOffset("scale");
-       prog->fieldoffsets.alpha = PRVM_ED_FindFieldOffset("alpha");
-       prog->fieldoffsets.renderamt = PRVM_ED_FindFieldOffset("renderamt"); // HalfLife support
-       prog->fieldoffsets.rendermode = PRVM_ED_FindFieldOffset("rendermode"); // HalfLife support
-       prog->fieldoffsets.fullbright = PRVM_ED_FindFieldOffset("fullbright");
-       prog->fieldoffsets.ammo_shells1 = PRVM_ED_FindFieldOffset("ammo_shells1");
-       prog->fieldoffsets.ammo_nails1 = PRVM_ED_FindFieldOffset("ammo_nails1");
-       prog->fieldoffsets.ammo_lava_nails = PRVM_ED_FindFieldOffset("ammo_lava_nails");
-       prog->fieldoffsets.ammo_rockets1 = PRVM_ED_FindFieldOffset("ammo_rockets1");
-       prog->fieldoffsets.ammo_multi_rockets = PRVM_ED_FindFieldOffset("ammo_multi_rockets");
-       prog->fieldoffsets.ammo_cells1 = PRVM_ED_FindFieldOffset("ammo_cells1");
-       prog->fieldoffsets.ammo_plasma = PRVM_ED_FindFieldOffset("ammo_plasma");
-       prog->fieldoffsets.ideal_yaw = PRVM_ED_FindFieldOffset("ideal_yaw");
-       prog->fieldoffsets.yaw_speed = PRVM_ED_FindFieldOffset("yaw_speed");
-       prog->fieldoffsets.idealpitch = PRVM_ED_FindFieldOffset("idealpitch");
-       prog->fieldoffsets.pitch_speed = PRVM_ED_FindFieldOffset("pitch_speed");
-       prog->fieldoffsets.viewmodelforclient = PRVM_ED_FindFieldOffset("viewmodelforclient");
-       prog->fieldoffsets.nodrawtoclient = PRVM_ED_FindFieldOffset("nodrawtoclient");
-       prog->fieldoffsets.exteriormodeltoclient = PRVM_ED_FindFieldOffset("exteriormodeltoclient");
-       prog->fieldoffsets.drawonlytoclient = PRVM_ED_FindFieldOffset("drawonlytoclient");
-       prog->fieldoffsets.ping = PRVM_ED_FindFieldOffset("ping");
-       prog->fieldoffsets.movement = PRVM_ED_FindFieldOffset("movement");
-       prog->fieldoffsets.pmodel = PRVM_ED_FindFieldOffset("pmodel");
-       prog->fieldoffsets.punchvector = PRVM_ED_FindFieldOffset("punchvector");
-       prog->fieldoffsets.viewzoom = PRVM_ED_FindFieldOffset("viewzoom");
-       prog->fieldoffsets.clientcolors = PRVM_ED_FindFieldOffset("clientcolors");
-       prog->fieldoffsets.tag_entity = PRVM_ED_FindFieldOffset("tag_entity");
-       prog->fieldoffsets.tag_index = PRVM_ED_FindFieldOffset("tag_index");
-       prog->fieldoffsets.light_lev = PRVM_ED_FindFieldOffset("light_lev");
-       prog->fieldoffsets.color = PRVM_ED_FindFieldOffset("color");
-       prog->fieldoffsets.style = PRVM_ED_FindFieldOffset("style");
-       prog->fieldoffsets.pflags = PRVM_ED_FindFieldOffset("pflags");
-       prog->fieldoffsets.cursor_active = PRVM_ED_FindFieldOffset("cursor_active");
-       prog->fieldoffsets.cursor_screen = PRVM_ED_FindFieldOffset("cursor_screen");
-       prog->fieldoffsets.cursor_trace_start = PRVM_ED_FindFieldOffset("cursor_trace_start");
-       prog->fieldoffsets.cursor_trace_endpos = PRVM_ED_FindFieldOffset("cursor_trace_endpos");
-       prog->fieldoffsets.cursor_trace_ent = PRVM_ED_FindFieldOffset("cursor_trace_ent");
-       prog->fieldoffsets.colormod = PRVM_ED_FindFieldOffset("colormod");
-       prog->fieldoffsets.playermodel = PRVM_ED_FindFieldOffset("playermodel");
-       prog->fieldoffsets.playerskin = PRVM_ED_FindFieldOffset("playerskin");
-       prog->fieldoffsets.SendEntity = PRVM_ED_FindFieldOffset("SendEntity");
-       prog->fieldoffsets.Version = PRVM_ED_FindFieldOffset("Version");
-       prog->fieldoffsets.customizeentityforclient = PRVM_ED_FindFieldOffset("customizeentityforclient");
-       prog->fieldoffsets.dphitcontentsmask = PRVM_ED_FindFieldOffset("dphitcontentsmask");
-       prog->fieldoffsets.contentstransition = PRVM_ED_FindFieldOffset("contentstransition");
-       prog->globaloffsets.trace_dpstartcontents = PRVM_ED_FindGlobalOffset("trace_dpstartcontents");
-       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.SV_InitCmd = PRVM_ED_FindGlobalOffset("SV_InitCmd");
-       prog->funcoffsets.SV_ParseClientCommand = PRVM_ED_FindFunctionOffset("SV_ParseClientCommand");
-       prog->funcoffsets.SV_PlayerPhysics = PRVM_ED_FindFunctionOffset("SV_PlayerPhysics");
-       prog->funcoffsets.SV_ChangeTeam = PRVM_ED_FindFunctionOffset("SV_ChangeTeam");
-       prog->funcoffsets.EndFrame = PRVM_ED_FindFunctionOffset("EndFrame");
-       prog->funcoffsets.RestoreGame = PRVM_ED_FindFunctionOffset("RestoreGame");
-
-       // csqc
-       prog->fieldoffsets.alpha = PRVM_ED_FindFieldOffset("alpha");
-       prog->fieldoffsets.scale = PRVM_ED_FindFieldOffset("scale");
-       //prog->fieldoffsets.fatness = PRVM_ED_FindFieldOffset("fatness");
-       prog->fieldoffsets.frame2 = PRVM_ED_FindFieldOffset("frame2");
-       prog->fieldoffsets.frame1time = PRVM_ED_FindFieldOffset("frame1time");
-       prog->fieldoffsets.frame2time = PRVM_ED_FindFieldOffset("frame2time");
-       prog->fieldoffsets.lerpfrac = PRVM_ED_FindFieldOffset("lerpfrac");
-       prog->fieldoffsets.renderflags = PRVM_ED_FindFieldOffset("renderflags");
-       //prog->fieldoffsets.forceshader = PRVM_ED_FindFieldOffset("forceshader");
-       //prog->fieldoffsets.dimension_hit = PRVM_ED_FindFieldOffset("dimension_hit");
-       //prog->fieldoffsets.dimension_solid = PRVM_ED_FindFieldOffset("dimension_solid");
-       //prog->fieldoffsets.groundentity = PRVM_ED_FindFieldOffset("groundentity");
-       //prog->fieldoffsets.hull = PRVM_ED_FindFieldOffset("hull");
-       prog->fieldoffsets.colormod = PRVM_ED_FindFieldOffset("colormod");
-       prog->fieldoffsets.effects = PRVM_ED_FindFieldOffset("effects");
-       prog->fieldoffsets.tag_entity = PRVM_ED_FindFieldOffset("tag_entity");
-       prog->fieldoffsets.tag_index = PRVM_ED_FindFieldOffset("tag_index");
-       prog->funcoffsets.CSQC_Init = PRVM_ED_FindFunctionOffset("CSQC_Init");
-       prog->funcoffsets.CSQC_InputEvent = PRVM_ED_FindFunctionOffset("CSQC_InputEvent");
-       prog->funcoffsets.CSQC_UpdateView = PRVM_ED_FindFunctionOffset("CSQC_UpdateView");
-       prog->funcoffsets.CSQC_ConsoleCommand = PRVM_ED_FindFunctionOffset("CSQC_ConsoleCommand");
-       prog->funcoffsets.CSQC_Shutdown = PRVM_ED_FindFunctionOffset("CSQC_Shutdown");
-       prog->funcoffsets.CSQC_Parse_TempEntity = PRVM_ED_FindFunctionOffset("CSQC_Parse_TempEntity");
-       prog->funcoffsets.CSQC_Parse_StuffCmd = PRVM_ED_FindFunctionOffset("CSQC_Parse_StuffCmd");
-       prog->funcoffsets.CSQC_Parse_Print = PRVM_ED_FindFunctionOffset("CSQC_Parse_Print");
-       prog->funcoffsets.CSQC_Parse_CenterPrint = PRVM_ED_FindFunctionOffset("CSQC_Parse_CenterPrint");
-       prog->funcoffsets.CSQC_Ent_Update = PRVM_ED_FindFunctionOffset("CSQC_Ent_Update");
-       prog->funcoffsets.CSQC_Ent_Remove = PRVM_ED_FindFunctionOffset("CSQC_Ent_Remove");
-       prog->funcoffsets.CSQC_Event = PRVM_ED_FindFunctionOffset("CSQC_Event");
-
-       // mqc
-       prog->funcoffsets.m_init = PRVM_ED_FindFunctionOffset("m_init");
-#ifdef NG_MENU
-       prog->funcoffsets.m_display = PRVM_ED_FindFunctionOffset("m_display");
-       prog->funcoffsets.m_hide = PRVM_ED_FindFunctionOffset("m_hide");
-#endif
-       prog->funcoffsets.m_keydown = PRVM_ED_FindFunctionOffset("m_keydown");
-       prog->funcoffsets.m_keyup = PRVM_ED_FindFunctionOffset("m_keyup");
-       prog->funcoffsets.m_draw = PRVM_ED_FindFunctionOffset("m_draw");
-       prog->funcoffsets.m_toggle = PRVM_ED_FindFunctionOffset("m_toggle");
-       prog->funcoffsets.m_shutdown = PRVM_ED_FindFunctionOffset("m_shutdown");
+       // server and client qc use a lot of similar fields, so this is combined
+       prog->fieldoffsets.SendEntity                     = PRVM_ED_FindFieldOffset("SendEntity");
+       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.clientcolors                   = PRVM_ED_FindFieldOffset("clientcolors");
+       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.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.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.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.light_lev                      = PRVM_ED_FindFieldOffset("light_lev");
+       prog->fieldoffsets.movement                       = PRVM_ED_FindFieldOffset("movement");
+       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.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.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->funcoffsets.CSQC_ConsoleCommand             = PRVM_ED_FindFunctionOffset("CSQC_ConsoleCommand");
+       prog->funcoffsets.CSQC_Ent_Remove                 = PRVM_ED_FindFunctionOffset("CSQC_Ent_Remove");
+       prog->funcoffsets.CSQC_Ent_Update                 = PRVM_ED_FindFunctionOffset("CSQC_Ent_Update");
+       prog->funcoffsets.CSQC_Event                      = PRVM_ED_FindFunctionOffset("CSQC_Event");
+       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.RestoreGame                     = PRVM_ED_FindFunctionOffset("RestoreGame");
+       prog->funcoffsets.SV_ChangeTeam                   = PRVM_ED_FindFunctionOffset("SV_ChangeTeam");
+       prog->funcoffsets.SV_ParseClientCommand           = PRVM_ED_FindFunctionOffset("SV_ParseClientCommand");
+       prog->funcoffsets.SV_PlayerPhysics                = PRVM_ED_FindFunctionOffset("SV_PlayerPhysics");
+       prog->globaloffsets.SV_InitCmd                    = PRVM_ED_FindGlobalOffset("SV_InitCmd");
+       prog->globaloffsets.self                          = PRVM_ED_FindGlobalOffset("self");
+       prog->globaloffsets.time                          = PRVM_ED_FindGlobalOffset("time");
+       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.trace_allsolid                = PRVM_ED_FindGlobalOffset("trace_allsolid");
+       prog->globaloffsets.trace_startsolid              = PRVM_ED_FindGlobalOffset("trace_startsolid");
+       prog->globaloffsets.trace_fraction                = PRVM_ED_FindGlobalOffset("trace_fraction");
+       prog->globaloffsets.trace_inwater                 = PRVM_ED_FindGlobalOffset("trace_inwater");
+       prog->globaloffsets.trace_inopen                  = PRVM_ED_FindGlobalOffset("trace_inopen");
+       prog->globaloffsets.trace_endpos                  = PRVM_ED_FindGlobalOffset("trace_endpos");
+       prog->globaloffsets.trace_plane_normal            = PRVM_ED_FindGlobalOffset("trace_plane_normal");
+       prog->globaloffsets.trace_plane_dist              = PRVM_ED_FindGlobalOffset("trace_plane_dist");
+       prog->globaloffsets.trace_ent                     = PRVM_ED_FindGlobalOffset("trace_ent");
+       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");
+
+       // menu qc only uses some functions, nothing else
+       prog->funcoffsets.m_display                       = PRVM_ED_FindFunctionOffset("m_display");
+       prog->funcoffsets.m_draw                          = PRVM_ED_FindFunctionOffset("m_draw");
+       prog->funcoffsets.m_hide                          = PRVM_ED_FindFunctionOffset("m_hide");
+       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");
 }
 
 // not used