From: bones_was_here Date: Sat, 22 Jul 2023 19:43:21 +0000 (+1000) Subject: items: Apply vertical offset on Q3 maps to match Q3 bbox floor height X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=709aeacecf200fc4606f07428cc40e6cacd411e5;p=xonotic%2Fxonotic-data.pk3dir.git 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. --- 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