vec3_t mins, maxs, start, stop;
trace_t trace;
int x, y;
- float mid, bottom;
+ float mid, bottom, stepheight;
VM_SAFEPARMCOUNT(1, VM_CL_checkbottom);
ent = PRVM_G_EDICT(OFS_PARM0);
PRVM_G_FLOAT(OFS_RETURN) = 0;
+ stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, mins), mins);
VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, maxs), maxs);
// the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
- stop[2] = start[2] - 2*sv_stepheight.value;
+ stop[2] = start[2] - 2*stepheight;
trace = CL_TraceLine(start, stop, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, NULL, true, false);
if (trace.fraction == 1.0)
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
- if (trace.fraction == 1.0 || mid - trace.endpos[2] > sv_stepheight.value)
+ if (trace.fraction == 1.0 || mid - trace.endpos[2] > stepheight)
return;
}
vec3_t mins, maxs, start, stop;
trace_t trace;
int x, y;
- float mid, bottom;
+ float mid, bottom, stepheight;
+ stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, mins), mins);
VectorAdd (PRVM_clientedictvector(ent, origin), PRVM_clientedictvector(ent, maxs), maxs);
// the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
- stop[2] = start[2] - 2*sv_stepheight.value;
+ stop[2] = start[2] - 2*stepheight;
trace = CL_TraceLine(start, stop, MOVE_NOMONSTERS, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, false, NULL, true, false);
if (trace.fraction == 1.0)
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
- if (trace.fraction == 1.0 || mid - trace.endpos[2] > sv_stepheight.value)
+ if (trace.fraction == 1.0 || mid - trace.endpos[2] > stepheight)
return false;
}
static qboolean CL_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
{
prvm_prog_t *prog = CLVM_prog;
- float dz;
+ float dz, stepheight;
vec3_t oldorg, neworg, end, traceendpos;
vec3_t mins, maxs, start;
trace_t trace;
int i, svent;
prvm_edict_t *enemy;
+ stepheight = sv_stepheight.value + PRVM_clientedictfloat(ent, stepheight_delta);
+
// try the move
VectorCopy(PRVM_clientedictvector(ent, mins), mins);
VectorCopy(PRVM_clientedictvector(ent, maxs), maxs);
}
// push down from a step height above the wished position
- neworg[2] += sv_stepheight.value;
+ neworg[2] += stepheight;
VectorCopy (neworg, end);
- end[2] -= sv_stepheight.value*2;
+ end[2] -= stepheight*2;
trace = CL_TraceBox(neworg, mins, maxs, end, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, &svent, true);
if (settrace)
if (trace.startsolid)
{
- neworg[2] -= sv_stepheight.value;
+ neworg[2] -= stepheight;
trace = CL_TraceBox(neworg, mins, maxs, end, MOVE_NORMAL, ent, CL_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value, true, true, &svent, true);
if (settrace)
CL_VM_SetTraceGlobals(prog, &trace, svent);
PRVM_DECLARE_clientfieldfloat(skeletonindex)
PRVM_DECLARE_clientfieldfloat(skin)
PRVM_DECLARE_clientfieldfloat(solid)
+PRVM_DECLARE_clientfieldfloat(stepheight_delta)
PRVM_DECLARE_clientfieldfloat(tag_index)
PRVM_DECLARE_clientfieldfloat(userwavefunc_param0)
PRVM_DECLARE_clientfieldfloat(userwavefunc_param1)
PRVM_DECLARE_field(solid)
PRVM_DECLARE_field(sounds)
PRVM_DECLARE_field(spawnflags)
+PRVM_DECLARE_field(stepheight_delta)
PRVM_DECLARE_field(style)
PRVM_DECLARE_field(tag_entity)
PRVM_DECLARE_field(tag_index)
PRVM_DECLARE_global(parm14)
PRVM_DECLARE_global(parm15)
PRVM_DECLARE_global(parm16)
+PRVM_DECLARE_global(parm17)
+PRVM_DECLARE_global(parm18)
+PRVM_DECLARE_global(parm19)
+PRVM_DECLARE_global(parm20)
+PRVM_DECLARE_global(parm21)
+PRVM_DECLARE_global(parm22)
+PRVM_DECLARE_global(parm23)
+PRVM_DECLARE_global(parm24)
+PRVM_DECLARE_global(parm25)
+PRVM_DECLARE_global(parm26)
+PRVM_DECLARE_global(parm27)
+PRVM_DECLARE_global(parm28)
+PRVM_DECLARE_global(parm29)
+PRVM_DECLARE_global(parm30)
+PRVM_DECLARE_global(parm31)
+PRVM_DECLARE_global(parm32)
+PRVM_DECLARE_global(parm33)
+PRVM_DECLARE_global(parm34)
+PRVM_DECLARE_global(parm35)
+PRVM_DECLARE_global(parm36)
+PRVM_DECLARE_global(parm37)
+PRVM_DECLARE_global(parm38)
+PRVM_DECLARE_global(parm39)
+PRVM_DECLARE_global(parm40)
+PRVM_DECLARE_global(parm41)
+PRVM_DECLARE_global(parm42)
+PRVM_DECLARE_global(parm43)
+PRVM_DECLARE_global(parm44)
+PRVM_DECLARE_global(parm45)
+PRVM_DECLARE_global(parm46)
+PRVM_DECLARE_global(parm47)
+PRVM_DECLARE_global(parm48)
+PRVM_DECLARE_global(parm49)
+PRVM_DECLARE_global(parm50)
+PRVM_DECLARE_global(parm51)
+PRVM_DECLARE_global(parm52)
+PRVM_DECLARE_global(parm53)
+PRVM_DECLARE_global(parm54)
+PRVM_DECLARE_global(parm55)
+PRVM_DECLARE_global(parm56)
+PRVM_DECLARE_global(parm57)
+PRVM_DECLARE_global(parm58)
+PRVM_DECLARE_global(parm59)
+PRVM_DECLARE_global(parm60)
+PRVM_DECLARE_global(parm61)
+PRVM_DECLARE_global(parm62)
+PRVM_DECLARE_global(parm63)
+PRVM_DECLARE_global(parm64)
PRVM_DECLARE_global(particle_airfriction)
PRVM_DECLARE_global(particle_alpha)
PRVM_DECLARE_global(particle_alphafade)
PRVM_DECLARE_serverfieldfloat(solid)
PRVM_DECLARE_serverfieldfloat(sounds)
PRVM_DECLARE_serverfieldfloat(spawnflags)
+PRVM_DECLARE_serverfieldfloat(stepheight_delta)
PRVM_DECLARE_serverfieldfloat(style)
PRVM_DECLARE_serverfieldfloat(tag_index)
PRVM_DECLARE_serverfieldfloat(takedamage)
vec3_t mins, maxs, start, stop;
trace_t trace;
int x, y;
- float mid, bottom;
+ float mid, bottom, stepheight;
+ stepheight = sv_stepheight.value + PRVM_serveredictfloat(ent, stepheight_delta);
VectorAdd (PRVM_serveredictvector(ent, origin), PRVM_serveredictvector(ent, mins), mins);
VectorAdd (PRVM_serveredictvector(ent, origin), PRVM_serveredictvector(ent, maxs), maxs);
// the midpoint must be within 16 of the bottom
start[0] = stop[0] = (mins[0] + maxs[0])*0.5;
start[1] = stop[1] = (mins[1] + maxs[1])*0.5;
- stop[2] = start[2] - 2*sv_stepheight.value;
+ stop[2] = start[2] - 2*stepheight;
trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
if (trace.fraction == 1.0)
if (trace.fraction != 1.0 && trace.endpos[2] > bottom)
bottom = trace.endpos[2];
- if (trace.fraction == 1.0 || mid - trace.endpos[2] > sv_stepheight.value)
+ if (trace.fraction == 1.0 || mid - trace.endpos[2] > stepheight)
return false;
}
qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace)
{
prvm_prog_t *prog = SVVM_prog;
- float dz;
+ float dz, stepheight;
vec3_t oldorg, neworg, end, traceendpos, entorigin, entmins, entmaxs;
trace_t trace;
int i;
prvm_edict_t *enemy;
+ stepheight = sv_stepheight.value + PRVM_serveredictfloat(ent, stepheight_delta);
+
// try the move
VectorCopy (PRVM_serveredictvector(ent, origin), oldorg);
VectorAdd (PRVM_serveredictvector(ent, origin), move, neworg);
}
// push down from a step height above the wished position
- neworg[2] += sv_stepheight.value;
+ neworg[2] += stepheight;
VectorCopy (neworg, end);
- end[2] -= sv_stepheight.value*2;
+ end[2] -= stepheight*2;
trace = SV_TraceBox(neworg, entmins, entmaxs, end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
if (trace.startsolid)
{
- neworg[2] -= sv_stepheight.value;
+ neworg[2] -= stepheight;
trace = SV_TraceBox(neworg, entmins, entmaxs, end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value);
if (trace.startsolid)
return false;
vec3_t upmove, downmove, start_origin, start_velocity, stepnormal, originalmove_origin, originalmove_velocity, entmins, entmaxs;
trace_t downtrace, trace;
qboolean applygravity;
+ float stepheight;
// if frametime is 0 (due to client sending the same timestamp twice),
// don't move
if (sv_gameplayfix_unstickplayers.integer)
SV_CheckStuck (ent);
+ stepheight = sv_stepheight.value + PRVM_serveredictfloat(ent, stepheight_delta);
+
applygravity = !SV_CheckWater (ent) && PRVM_serveredictfloat(ent, movetype) == MOVETYPE_WALK && ! ((int)PRVM_serveredictfloat(ent, flags) & FL_WATERJUMP);
SV_CheckVelocity(ent);
VectorCopy (PRVM_serveredictvector(ent, origin), start_origin);
VectorCopy (PRVM_serveredictvector(ent, velocity), start_velocity);
- clip = SV_FlyMove (ent, sv.frametime, applygravity, NULL, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, sv_gameplayfix_stepmultipletimes.integer ? sv_stepheight.value : 0);
+ clip = SV_FlyMove (ent, sv.frametime, applygravity, NULL, hitsupercontentsmask, skipsupercontentsmask, skipmaterialflagsmask, sv_gameplayfix_stepmultipletimes.integer ? stepheight : 0);
if(sv_gameplayfix_downtracesupportsongroundflag.integer)
if(!(clip & 1))
// move up
VectorClear (upmove);
- upmove[2] = sv_stepheight.value;
+ upmove[2] = stepheight;
if(!SV_PushEntity(&trace, ent, upmove, true))
{
// we got teleported when upstepping... must abort the move
// move down
VectorClear (downmove);
- downmove[2] = -sv_stepheight.value + start_velocity[2]*sv.frametime;
+ downmove[2] = -stepheight + start_velocity[2]*sv.frametime;
if(!SV_PushEntity (&downtrace, ent, downmove, true))
{
// we got teleported when downstepping... must abort the move