From dc43859d302ddbe54ad41ac6fe518e08f034d689 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 18 Sep 2022 11:08:58 +1000 Subject: [PATCH] Fix some discrepancies in the QC port of droptofloor --- qcsrc/server/world.qc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 43e697f2d..72499866f 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -2193,6 +2193,7 @@ void InitializeEntitiesRun() } // deferred dropping +// ported from VM_SV_droptofloor TODO: make a common function for the client-side? void DropToFloor_Handler(entity this) { if(!this || wasfreed(this)) @@ -2213,6 +2214,7 @@ void DropToFloor_Handler(entity this) { vector offset, org; offset = 0.5 * (this.mins + this.maxs); + offset.z = this.mins.z; org = this.origin + offset; traceline(org, end, MOVE_NORMAL, this); trace_endpos = trace_endpos - offset; @@ -2220,6 +2222,7 @@ void DropToFloor_Handler(entity this) { LOG_DEBUGF("DropToFloor_Handler: %v could not fix badly placed entity", this.origin); _Movetype_LinkEdict(this, false); + SET_ONGROUND(this); this.groundentity = NULL; } else if(trace_fraction < 1) @@ -2228,6 +2231,7 @@ void DropToFloor_Handler(entity this) //if(autocvar_sv_gameplayfix_droptofloorstartsolid_nudgetocorrect) //SV_NudgeOutOfSolid(this); setorigin(this, trace_endpos); + SET_ONGROUND(this); this.groundentity = trace_ent; // if support is destroyed, keep suspended (gross hack for floating items in various maps) this.move_suspendedinair = true; @@ -2238,12 +2242,12 @@ void DropToFloor_Handler(entity this) if(!trace_allsolid && trace_fraction < 1) { setorigin(this, trace_endpos); + SET_ONGROUND(this); this.groundentity = trace_ent; // if support is destroyed, keep suspended (gross hack for floating items in various maps) this.move_suspendedinair = true; } } - SET_ONGROUND(this); this.dropped_origin = this.origin; } -- 2.39.2