+
+ if (ent->v->movetype != MOVETYPE_FLY)
+ {
+ // return if gibbed by a trigger
+ if (ent->v->movetype != MOVETYPE_WALK)
+ return;
+
+ // only step up while jumping if that is enabled
+ if (!(sv_jumpstep.integer && sv_gameplayfix_stepwhilejumping.integer))
+ if (!oldonground && ent->v->waterlevel == 0)
+ return;
+ }
+
+ // try moving up and forward to go up a step
+ // back to start pos
+ VectorCopy (start_origin, ent->v->origin);
+ VectorCopy (start_velocity, ent->v->velocity);
+
+ // move up
+ VectorClear (upmove);
+ upmove[2] = sv_stepheight.value;
+ // FIXME: don't link?
+ SV_PushEntity(ent, upmove);
+
+ // move forward
+ ent->v->velocity[2] = 0;
+ clip = SV_FlyMove (ent, sv.frametime, stepnormal);
+ ent->v->velocity[2] += start_velocity[2];
+
+ SV_CheckVelocity(ent);
+
+ // check for stuckness, possibly due to the limited precision of floats
+ // in the clipping hulls
+ if (clip
+ && fabs(originalmove_origin[1] - ent->v->origin[1]) < 0.03125
+ && fabs(originalmove_origin[0] - ent->v->origin[0]) < 0.03125)
+ {
+ //Con_Printf("wall\n");
+ // stepping up didn't make any progress, revert to original move
+ VectorCopy(originalmove_origin, ent->v->origin);
+ VectorCopy(originalmove_velocity, ent->v->velocity);
+ //clip = originalmove_clip;
+ ent->v->flags = originalmove_flags;
+ ent->v->groundentity = originalmove_groundentity;
+ // now try to unstick if needed
+ //clip = SV_TryUnstick (ent, oldvel);