X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=sv_move.c;h=0699180d12f6e3bcdd1460723a6a157ff346d9e8;hp=eb577c77721975b6e27e945fb8d73434ae50a662;hb=e9206d59c8cde436ea29daa46a587db08f73a111;hpb=cfee52a1ec9db338098789cae89ae5cf1f7a6fbf diff --git a/sv_move.c b/sv_move.c index eb577c77..0699180d 100644 --- a/sv_move.c +++ b/sv_move.c @@ -33,7 +33,7 @@ is not a staircase. */ int c_yes, c_no; -qboolean SV_CheckBottom (prvm_edict_t *ent) +qbool SV_CheckBottom (prvm_edict_t *ent) { prvm_prog_t *prog = SVVM_prog; vec3_t mins, maxs, start, stop; @@ -71,7 +71,7 @@ realcheck: 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; - trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, ent, SV_GenericHitSuperContentsMask(ent)); + trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value); if (trace.fraction == 1.0) return false; @@ -84,7 +84,7 @@ realcheck: start[0] = stop[0] = x ? maxs[0] : mins[0]; start[1] = stop[1] = y ? maxs[1] : mins[1]; - trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, ent, SV_GenericHitSuperContentsMask(ent)); + trace = SV_TraceLine(start, stop, MOVE_NOMONSTERS, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value); if (trace.fraction != 1.0 && trace.endpos[2] > bottom) bottom = trace.endpos[2]; @@ -106,11 +106,11 @@ The move will be adjusted for slopes and stairs, but if the move isn't possible, no move is done and false is returned ============= */ -qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean noenemy, qboolean settrace) +qbool SV_movestep (prvm_edict_t *ent, vec3_t move, qbool relink, qbool noenemy, qbool settrace) { prvm_prog_t *prog = SVVM_prog; float dz; - vec3_t oldorg, neworg, end, traceendpos; + vec3_t oldorg, neworg, end, traceendpos, entorigin, entmins, entmaxs; trace_t trace; int i; prvm_edict_t *enemy; @@ -118,6 +118,8 @@ qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean // try the move VectorCopy (PRVM_serveredictvector(ent, origin), oldorg); VectorAdd (PRVM_serveredictvector(ent, origin), move, neworg); + VectorCopy(PRVM_serveredictvector(ent, mins), entmins); + VectorCopy(PRVM_serveredictvector(ent, maxs), entmaxs); // flying monsters don't step up if ( (int)PRVM_serveredictfloat(ent, flags) & (FL_SWIM | FL_FLY) ) @@ -140,7 +142,8 @@ qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean neworg[2] += 8; } } - trace = SV_TraceBox(PRVM_serveredictvector(ent, origin), PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), neworg, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent)); + VectorCopy(PRVM_serveredictvector(ent, origin), entorigin); + trace = SV_TraceBox(entorigin, entmins, entmaxs, neworg, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value); if (trace.fraction == 1) { @@ -169,12 +172,12 @@ qboolean SV_movestep (prvm_edict_t *ent, vec3_t move, qboolean relink, qboolean VectorCopy (neworg, end); end[2] -= sv_stepheight.value*2; - trace = SV_TraceBox(neworg, PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent)); + 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; - trace = SV_TraceBox(neworg, PRVM_serveredictvector(ent, mins), PRVM_serveredictvector(ent, maxs), end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent)); + trace = SV_TraceBox(neworg, entmins, entmaxs, end, MOVE_NORMAL, ent, SV_GenericHitSuperContentsMask(ent), 0, 0, collision_extendmovelength.value); if (trace.startsolid) return false; } @@ -251,7 +254,7 @@ facing it. ====================== */ -static qboolean SV_StepDirection (prvm_edict_t *ent, float yaw, float dist) +static qbool SV_StepDirection (prvm_edict_t *ent, float yaw, float dist) { prvm_prog_t *prog = SVVM_prog; vec3_t move, oldorigin; @@ -394,7 +397,7 @@ SV_CloseEnough ====================== */ -static qboolean SV_CloseEnough (prvm_edict_t *ent, prvm_edict_t *goal, float dist) +static qbool SV_CloseEnough (prvm_edict_t *ent, prvm_edict_t *goal, float dist) { int i; @@ -410,7 +413,7 @@ static qboolean SV_CloseEnough (prvm_edict_t *ent, prvm_edict_t *goal, float dis /* ====================== -SV_MoveToGoal +VM_SV_MoveToGoal ====================== */ @@ -419,7 +422,7 @@ void VM_SV_MoveToGoal(prvm_prog_t *prog) prvm_edict_t *ent, *goal; float dist; - VM_SAFEPARMCOUNT(1, SV_MoveToGoal); + VM_SAFEPARMCOUNT(1, VM_SV_MoveToGoal); ent = PRVM_PROG_TO_EDICT(PRVM_serverglobaledict(self)); goal = PRVM_PROG_TO_EDICT(PRVM_serveredictedict(ent, goalentity));