extern cvar_t sv_gameplayfix_stepwhilejumping;
extern cvar_t sv_gameplayfix_swiminbmodels;
extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag;
+extern cvar_t sv_gameplayfix_downtracesupportsongroundflag;
extern cvar_t sv_gravity;
extern cvar_t sv_idealpitchscale;
extern cvar_t sv_jumpstep;
clip = SV_FlyMove (ent, sv.frametime, applygravity, NULL, hitsupercontentsmask);
- // if the move did not hit the ground at any point, we're not on ground
+ if(sv_gameplayfix_downtracesupportsongroundflag.integer)
if(!(clip & 1))
+ {
// only try this if there was no floor in the way in the trace (no,
// this check seems to be not REALLY necessary, because if clip & 1,
// our trace will hit that thing too)
- {
VectorSet(upmove, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] + 1);
VectorSet(downmove, ent->fields.server->origin[0], ent->fields.server->origin[1], ent->fields.server->origin[2] - 1);
if (ent->fields.server->movetype == MOVETYPE_FLYMISSILE)
else
type = MOVE_NORMAL;
trace = SV_TraceBox(upmove, ent->fields.server->mins, ent->fields.server->maxs, downmove, type, ent, SV_GenericHitSuperContentsMask(ent));
- if(trace.fraction >= 1 || trace.plane.normal[2] <= 0.7)
- ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_ONGROUND;
+ if(trace.fraction < 1 && trace.plane.normal[2] > 0.7)
+ clip |= 1; // but we HAVE found a floor
}
+ // if the move did not hit the ground at any point, we're not on ground
+ if(!(clip & 1))
+ ent->fields.server->flags = (int)ent->fields.server->flags & ~FL_ONGROUND;
+
SV_CheckVelocity(ent);
SV_LinkEdict(ent);
SV_LinkEdict_TouchAreaGrid(ent);