added pmove_onground to get this value from the engine prediction
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 May 2011 15:44:40 +0000 (15:44 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 9 May 2011 15:44:40 +0000 (15:44 +0000)
added pmove_inwater to get this value from the engine prediction

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

csprogs.c
progsvm.h
prvm_edict.c

index e17d45f..ea2471e 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -101,6 +101,8 @@ static void CSQC_SetGlobals (void)
                // completely replacing it
                Matrix4x4_OriginFromMatrix(&cl.entities[cl.viewentity].render.matrix, prog->globals.client->pmove_org);
                VectorCopy(cl.movement_velocity, prog->globals.client->pmove_vel);
+               PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.pmove_onground) = cl.onground;
+               PRVM_GLOBALFIELDFLOAT(prog->globaloffsets.pmove_inwater) = cl.inwater;
 
                VectorCopy(cl.viewangles, PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.view_angles));
                VectorCopy(cl.punchangle, PRVM_GLOBALFIELDVECTOR(prog->globaloffsets.view_punchangle));
@@ -884,6 +886,8 @@ prvm_required_field_t cl_reqglobals[] =
        {ev_float, "particle_velocityjitter"},
        {ev_float, "particles_alphamax"},
        {ev_float, "particles_alphamin"},
+       {ev_float, "pmove_onground"},
+       {ev_float, "pmove_inwater"},
        {ev_float, "require_spawnfunc_prefix"},
        {ev_float, "sb_showscores"},
        {ev_float, "serverdeltatime"},
index e4f8e12..0f81f29 100644 (file)
--- a/progsvm.h
+++ b/progsvm.h
@@ -347,6 +347,8 @@ typedef struct prvm_prog_globaloffsets_s
        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
index ed7701d..7aa2dae 100644 (file)
@@ -1748,6 +1748,8 @@ void PRVM_FindOffsets(void)
        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");
 
        // menu qc only uses some functions, nothing else
        prog->funcoffsets.m_draw                          = PRVM_ED_FindFunctionOffset("m_draw");