qboolean SV_movestep (edict_t *ent, vec3_t move, qboolean relink)
{
float dz;
- vec3_t oldorg, neworg, end;
+ vec3_t oldorg, neworg, end, traceendpos;
trace_t trace;
int i;
edict_t *enemy;
-// try the move
+// try the move
VectorCopy (ent->v.origin, oldorg);
VectorAdd (ent->v.origin, move, neworg);
neworg[2] += 8;
}
trace = SV_Move (ent->v.origin, ent->v.mins, ent->v.maxs, neworg, MOVE_NORMAL, ent);
-
+
if (trace.fraction == 1)
{
- if ( ((int)ent->v.flags & FL_SWIM) && SV_PointContents(trace.endpos) == CONTENTS_EMPTY )
+ VectorCopy(trace.endpos, traceendpos);
+ if ( ((int)ent->v.flags & FL_SWIM) && SV_PointContents(traceendpos) == CONTENTS_EMPTY )
return false; // swim monster left water
-
- VectorCopy (trace.endpos, ent->v.origin);
+
+ VectorCopy (traceendpos, ent->v.origin);
if (relink)
SV_LinkEdict (ent, true);
return true;
}
-
+
if (enemy == sv.edicts)
break;
}
-
+
return false;
}
if (relink)
SV_LinkEdict (ent, true);
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
-// Con_Printf ("fall down\n");
return true;
}
}
if ( (int)ent->v.flags & FL_PARTIALGROUND )
- {
-// Con_Printf ("back on ground\n");
ent->v.flags = (int)ent->v.flags & ~FL_PARTIALGROUND;
- }
+
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
// the move is ok
*/
void SV_FixCheckBottom (edict_t *ent)
{
-// Con_Printf ("SV_FixCheckBottom\n");
-
ent->v.flags = (int)ent->v.flags | FL_PARTIALGROUND;
}