From: divverent Date: Sat, 5 Dec 2009 20:18:23 +0000 (+0000) Subject: turn this into sv_gameplayfix_downtracesupportsongroundflag X-Git-Tag: xonotic-v0.1.0preview~1104 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=cbc1d1f6486479a673fe565d149a4e96287d6343 turn this into sv_gameplayfix_downtracesupportsongroundflag git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9542 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/server.h b/server.h index 6f281456..1c370d43 100644 --- a/server.h +++ b/server.h @@ -434,6 +434,7 @@ extern cvar_t sv_gameplayfix_stepdown; 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; diff --git a/sv_phys.c b/sv_phys.c index c8f73b83..7235fac7 100644 --- a/sv_phys.c +++ b/sv_phys.c @@ -2183,12 +2183,12 @@ void SV_WalkMove (prvm_edict_t *ent) 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) @@ -2198,10 +2198,14 @@ void SV_WalkMove (prvm_edict_t *ent) 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);