From 12a7c3cd61455849e4d3dd5cca19dfba53a51c68 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 22 Jan 2007 18:20:05 +0000 Subject: [PATCH] modified droptofloor to treat trace.startsolid as an acceptable situation, this prevents many items falling out of various user-made maps (including a critial item in level x2m4 of X-Men: Ravages of Apocalypse) added sv_gameplayfix_droptofloorstartsolid cvar to control this behavior git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6729 d7cf8633-e32d-0410-b094-e92efae38249 --- server.h | 1 + sv_main.c | 2 ++ svvm_cmds.c | 5 +++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/server.h b/server.h index 10047f67..76b7d418 100644 --- a/server.h +++ b/server.h @@ -299,6 +299,7 @@ extern cvar_t sv_gameplayfix_blowupfallenzombies; extern cvar_t sv_gameplayfix_findradiusdistancetobox; extern cvar_t sv_gameplayfix_qwplayerphysics; extern cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag; +extern cvar_t sv_gameplayfix_droptofloorstartsolid; extern cvar_t sys_ticrate; extern cvar_t sv_fixedframeratesingleplayer; diff --git a/sv_main.c b/sv_main.c index 00242d60..6e03daf1 100644 --- a/sv_main.c +++ b/sv_main.c @@ -57,6 +57,7 @@ cvar_t sv_gameplayfix_blowupfallenzombies = {0, "sv_gameplayfix_blowupfallenzomb cvar_t sv_gameplayfix_findradiusdistancetobox = {0, "sv_gameplayfix_findradiusdistancetobox", "1", "causes findradius to check the distance to the corner of a box rather than the center of the box, makes findradius detect bmodels such as very large doors that would otherwise be unaffected by splash damage"}; cvar_t sv_gameplayfix_qwplayerphysics = {0, "sv_gameplayfix_qwplayerphysics", "1", "changes water jumping to make it easier to get out of water, and prevents friction on landing when bunnyhopping"}; cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {0, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"}; +cvar_t sv_gameplayfix_droptofloorstartsolid = {0, "sv_gameplayfix_droptofloorstartsolid", "1", "prevents items and monsters that start in a solid area from falling out of the level (makes droptofloor treat trace_startsolid as an acceptable outcome)"}; cvar_t sv_progs = {0, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" }; @@ -128,6 +129,7 @@ void SV_Init (void) Cvar_RegisterVariable (&sv_gameplayfix_findradiusdistancetobox); Cvar_RegisterVariable (&sv_gameplayfix_qwplayerphysics); Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag); + Cvar_RegisterVariable (&sv_gameplayfix_droptofloorstartsolid); Cvar_RegisterVariable (&sv_protocolname); Cvar_RegisterVariable (&sv_ratelimitlocalplayer); Cvar_RegisterVariable (&sv_maxrate); diff --git a/svvm_cmds.c b/svvm_cmds.c index a97bdf1a..f01aeff8 100644 --- a/svvm_cmds.c +++ b/svvm_cmds.c @@ -938,9 +938,10 @@ void PF_droptofloor (void) trace = SV_Move (ent->fields.server->origin, ent->fields.server->mins, ent->fields.server->maxs, end, MOVE_NORMAL, ent); - if (trace.fraction != 1) + if (trace.fraction != 1 || (trace.startsolid && sv_gameplayfix_droptofloorstartsolid.integer)) { - VectorCopy (trace.endpos, ent->fields.server->origin); + if (trace.fraction < 1) + VectorCopy (trace.endpos, ent->fields.server->origin); SV_LinkEdict (ent, false); ent->fields.server->flags = (int)ent->fields.server->flags | FL_ONGROUND; ent->fields.server->groundentity = PRVM_EDICT_TO_PROG(trace.ent); -- 2.39.2