From 709aeacecf200fc4606f07428cc40e6cacd411e5 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sun, 23 Jul 2023 05:43:21 +1000 Subject: [PATCH] items: Apply vertical offset on Q3 maps to match Q3 bbox floor height The lack of this caused high-placed items to be stuck in a "ceiling" brush in a few cases (problematic for droptofloor). It also meant suspended items were too high, causing cases where a jump pad sent the player slightly under the item, with nothing they could do to reach it. --- qcsrc/server/items/items.qc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 23e11ec00..d09ea81aa 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -1082,11 +1082,19 @@ void StartItem(entity this, entity def) if(this.angles != '0 0 0') this.SendFlags |= ISF_ANGLES; - if(q3compat && !this.team) + if(q3compat) { - string t = GetField_fullspawndata(this, "team"); - // bones_was_here: this hack is cheaper than changing to a .string strcmp() - if(t) this.team = crc16(false, t); + if (!this.team) + { + string t = GetField_fullspawndata(this, "team"); + // bones_was_here: this hack is cheaper than changing to a .string strcmp() + if(t) this.team = crc16(false, t); + } + + // In Q3 the origin is in the middle of the bbox ("radius" 15), in Xon it's at the bottom + // so we need to offset vertically (only for items placed by the mapper). + this.origin.z += -15 - this.mins.z; + setorigin(this, this.origin); } // it's a level item -- 2.39.2