+ PRVM_serveredictfloat(ent, flags) = (int)PRVM_serveredictfloat(ent, flags) | FL_ONGROUND;
+ PRVM_serveredictedict(ent, groundentity) = PRVM_EDICT_TO_PROG(trace.ent);
+ }
+ }
+ else if (stepheight)
+ {
+ // step - handle it immediately
+ vec3_t org;
+ vec3_t steppush;
+ trace_t steptrace;
+ trace_t steptrace2;
+ trace_t steptrace3;
+ //Con_Printf("step %f %f %f : ", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+ VectorSet(steppush, 0, 0, stepheight);
+ VectorScale(PRVM_serveredictvector(ent, velocity), time_left, push);
+ VectorCopy(PRVM_serveredictvector(ent, origin), org);
+ if(!SV_PushEntity(&steptrace, ent, steppush, false, true))
+ {
+ blocked |= 8;
+ break;
+ }
+ //Con_Printf("%f %f %f : ", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+ if(!SV_PushEntity(&steptrace2, ent, push, false, true))
+ {
+ blocked |= 8;
+ break;
+ }
+ //Con_Printf("%f %f %f : ", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+ VectorSet(steppush, 0, 0, org[2] - PRVM_serveredictvector(ent, origin)[2]);
+ if(!SV_PushEntity(&steptrace3, ent, steppush, false, true))
+ {
+ blocked |= 8;
+ break;
+ }
+ //Con_Printf("%f %f %f : ", PRVM_serveredictvector(ent, origin)[0], PRVM_serveredictvector(ent, origin)[1], PRVM_serveredictvector(ent, origin)[2]);
+ // accept the new position if it made some progress...
+ // previously this checked if absolute distance >= 0.03125 which made stepping up unreliable
+ if (PRVM_serveredictvector(ent, origin)[0] - org[0] || PRVM_serveredictvector(ent, origin)[1] - org[1])
+ {
+ //Con_Printf("accepted (delta %f %f %f)\n", PRVM_serveredictvector(ent, origin)[0] - org[0], PRVM_serveredictvector(ent, origin)[1] - org[1], PRVM_serveredictvector(ent, origin)[2] - org[2]);
+ trace = steptrace2;
+ VectorCopy(PRVM_serveredictvector(ent, origin), trace.endpos);
+ time_left *= 1 - trace.fraction;
+ numplanes = 0;
+ continue;
+ }
+ else
+ {
+ //Con_Printf("REJECTED (delta %f %f %f)\n", PRVM_serveredictvector(ent, origin)[0] - org[0], PRVM_serveredictvector(ent, origin)[1] - org[1], PRVM_serveredictvector(ent, origin)[2] - org[2]);
+ VectorCopy(org, PRVM_serveredictvector(ent, origin));