]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
support pmove_flags (the actual flag values may be wrong, someone please find the...
[xonotic/darkplaces.git] / clvm_cmds.c
index ed960e8e8c539b875216951b4444dd0a5b8dc70e..ba7926c82c896ea75bd11754a21ea7c94772c3a3 100644 (file)
@@ -1451,18 +1451,15 @@ 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.onground = 0; // ???
-       s.crouched = 0; // ???
-       s.watertype = 0; // ???
-       s.waterlevel = 0; // ???
-       s.waterjumptime = 0; // ???
+       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];
        s.cmd.sidemove = PRVM_clientglobalvector(input_movevalues)[1];
        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; // ???
+       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;
 
@@ -1470,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)