]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
add a little bias to prevent constant contact cases with sv_gameplayfix_nudgeoutofsolid
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Nov 2009 23:07:12 +0000 (23:07 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Nov 2009 23:07:12 +0000 (23:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9408 d7cf8633-e32d-0410-b094-e92efae38249

server.h
sv_main.c
sv_phys.c

index 6a19f1b78bfe705f7fd49a635b10aa4aa648fe7d..06543a55271c2650fddf53003dd7daae9abd6995 100644 (file)
--- a/server.h
+++ b/server.h
@@ -429,6 +429,7 @@ extern cvar_t sv_gameplayfix_multiplethinksperframe;
 extern cvar_t sv_gameplayfix_noairborncorpse;
 extern cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems;
 extern cvar_t sv_gameplayfix_nudgeoutofsolid;
+extern cvar_t sv_gameplayfix_nudgeoutofsolid_bias;
 extern cvar_t sv_gameplayfix_setmodelrealbox;
 extern cvar_t sv_gameplayfix_slidemoveprojectiles;
 extern cvar_t sv_gameplayfix_stepdown;
index e3f5f45b8fc7c4009f3320bcc47491a358b798e9..8096d5588bd29f6dd1d882678f1fcad7429f887c 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -98,6 +98,7 @@ cvar_t sv_gameplayfix_multiplethinksperframe = {0, "sv_gameplayfix_multiplethink
 cvar_t sv_gameplayfix_noairborncorpse = {0, "sv_gameplayfix_noairborncorpse", "1", "causes entities (corpses, items, etc) sitting ontop of moving entities (players) to fall when the moving entity (player) is no longer supporting them"};
 cvar_t sv_gameplayfix_noairborncorpse_allowsuspendeditems = {0, "sv_gameplayfix_noairborncorpse_allowsuspendeditems", "1", "causes entities sitting ontop of objects that are instantaneously remove to float in midair (special hack to allow a common level design trick for floating items)"};
 cvar_t sv_gameplayfix_nudgeoutofsolid = {0, "sv_gameplayfix_nudgeoutofsolid", "1", "attempts to fix physics errors (where an object ended up in solid for some reason)"};
+cvar_t sv_gameplayfix_nudgeoutofsolid_bias = {0, "sv_gameplayfix_nudgeoutofsolid_bias", "0.03125", "over-correction on nudgeoutofsolid logic, to prevent constant contact"};
 cvar_t sv_gameplayfix_q2airaccelerate = {0, "sv_gameplayfix_q2airaccelerate", "0", "Quake2-style air acceleration"};
 cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1", "fixes a bug in Quake that made setmodel always set the entity box to ('-16 -16 -16', '16 16 16') rather than properly checking the model box, breaks some poorly coded mods"};
 cvar_t sv_gameplayfix_slidemoveprojectiles = {0, "sv_gameplayfix_slidemoveprojectiles", "1", "allows MOVETYPE_FLY/FLYMISSILE/TOSS/BOUNCE/BOUNCEMISSILE entities to finish their move in a frame even if they hit something, fixes 'gravity accumulation' bug for grenades on steep slopes"};
@@ -408,6 +409,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_gameplayfix_noairborncorpse);
        Cvar_RegisterVariable (&sv_gameplayfix_noairborncorpse_allowsuspendeditems);
        Cvar_RegisterVariable (&sv_gameplayfix_nudgeoutofsolid);
+       Cvar_RegisterVariable (&sv_gameplayfix_nudgeoutofsolid_bias);
        Cvar_RegisterVariable (&sv_gameplayfix_q2airaccelerate);
        Cvar_RegisterVariable (&sv_gameplayfix_setmodelrealbox);
        Cvar_RegisterVariable (&sv_gameplayfix_slidemoveprojectiles);
index 71ba23eed3dfd98cb15cd1bef8d4379354d13ea8..5c23977726e5607114374f8dc4adea526f95b5ee 100644 (file)
--- a/sv_phys.c
+++ b/sv_phys.c
@@ -1500,7 +1500,8 @@ static qboolean SV_PushEntity (trace_t *trace, prvm_edict_t *ent, vec3_t push, q
        bump = 0;
        while (trace->startsolid && sv_gameplayfix_nudgeoutofsolid.integer)
        {
-               VectorMA(ent->fields.server->origin, -trace->startdepth, trace->startdepthnormal, ent->fields.server->origin);
+               vec_t nudge = -trace->startdepth + sv_gameplayfix_nudgeoutofsolid_bias.value;
+               VectorMA(ent->fields.server->origin, nudge, trace->startdepthnormal, ent->fields.server->origin);
                *trace = SV_TraceBox(ent->fields.server->origin, ent->fields.server->mins, ent->fields.server->maxs, end, type, ent, SV_GenericHitSuperContentsMask(ent));
                bump++;
                if (bump > 10)