]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
support pmove_flags (the actual flag values may be wrong, someone please find the...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 12 Nov 2011 19:52:01 +0000 (19:52 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 12 Nov 2011 19:52:01 +0000 (19:52 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11551 d7cf8633-e32d-0410-b094-e92efae38249

clvm_cmds.c
prvm_offsets.h

index 1d40a1c91c428d1e9d847eb74cd73b4843f4b889..ba7926c82c896ea75bd11754a21ea7c94772c3a3 100644 (file)
@@ -1451,7 +1451,7 @@ static void VM_CL_runplayerphysics (prvm_prog_t *prog)
        VectorCopy(PRVM_clientedictvector(ent, velocity), s.velocity);
        VectorCopy(PRVM_clientglobalvector(pmove_mins), s.mins);
        VectorCopy(PRVM_clientglobalvector(pmove_maxs), s.maxs);
-       s.crouched = 0; // FIXME we need the current crouched status
+       s.crouched = ((int)PRVM_clientedictfloat(ent, pmove_flags) & 1) != 0; // FIXME which flag?
        s.waterjumptime = 0; // FIXME where do we get this from?
        VectorCopy(PRVM_clientglobalvector(input_angles), s.cmd.viewangles);
        s.cmd.forwardmove = PRVM_clientglobalvector(input_movevalues)[0];
@@ -1459,7 +1459,7 @@ static void VM_CL_runplayerphysics (prvm_prog_t *prog)
        s.cmd.upmove = PRVM_clientglobalvector(input_movevalues)[2];
        s.cmd.buttons = PRVM_clientglobalfloat(input_buttons);
        s.cmd.frametime = PRVM_clientglobalfloat(input_timelength);
-       s.cmd.canjump = 1; // FIXME we need the current canjump status
+       s.cmd.canjump = ((int)PRVM_clientedictfloat(ent, pmove_flags) & 2) != 0; // FIXME which flag?
        s.cmd.jump = (s.cmd.buttons & 2) != 0;
        s.cmd.crouch = (s.cmd.buttons & 16) != 0;
 
@@ -1467,6 +1467,9 @@ static void VM_CL_runplayerphysics (prvm_prog_t *prog)
 
        VectorCopy(s.origin, PRVM_clientedictvector(ent, origin));
        VectorCopy(s.velocity, PRVM_clientedictvector(ent, velocity));
+       PRVM_clientedictfloat(ent, pmove_flags) =
+               (s.crouched ? 1 : 0) |
+               (s.cmd.canjump ? 2 : 0);
 }
 
 //#348 string(float playernum, string keyname) getplayerkeyvalue (EXT_CSQC)
index 39f5d363be1ba7cfea5db6f121a40de04e2979d6..09ac75edcc95298ae85aba795704ffcc443cfc39 100644 (file)
@@ -35,6 +35,7 @@ PRVM_DECLARE_clientfieldfloat(modelindex)
 PRVM_DECLARE_clientfieldfloat(movetype)
 PRVM_DECLARE_clientfieldfloat(nextthink)
 PRVM_DECLARE_clientfieldfloat(pitch_speed)
+PRVM_DECLARE_clientfieldfloat(pmove_flags)
 PRVM_DECLARE_clientfieldfloat(renderflags)
 PRVM_DECLARE_clientfieldfloat(scale)
 PRVM_DECLARE_clientfieldfloat(shadertime)
@@ -338,6 +339,7 @@ PRVM_DECLARE_field(pitch_speed)
 PRVM_DECLARE_field(playermodel)
 PRVM_DECLARE_field(playerskin)
 PRVM_DECLARE_field(pmodel)
+PRVM_DECLARE_field(pmove_flags)
 PRVM_DECLARE_field(predraw)
 PRVM_DECLARE_field(punchangle)
 PRVM_DECLARE_field(punchvector)
@@ -824,4 +826,4 @@ 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
+PRVM_DECLARE_serverglobalvector(v_up)