From: bones_was_here Date: Mon, 3 Oct 2022 06:36:08 +0000 (+1000) Subject: Add support for teamed items on Q3 maps by using fullspawndata X-Git-Tag: xonotic-v0.8.6~340^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=63c516442e96d778630596668e950913897d9fc8;p=xonotic%2Fxonotic-data.pk3dir.git Add support for teamed items on Q3 maps by using fullspawndata Closes #2368 --- diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 5f89f7eea..cbc4ae440 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -976,6 +976,13 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default precache_model(this.model); precache_sound(this.item_pickupsound); + if(q3compat && !this.team) + { + string t = GetField_fullspawndata(this, "team", false); + // bones_was_here: this hack is cheaper than changing to a .string strcmp() + if(t) this.team = crc16(false, t); + } + if (Item_IsLoot(this)) { this.reset = SUB_Remove; diff --git a/qcsrc/server/main.qh b/qcsrc/server/main.qh index 172e0a9e5..40e708e86 100644 --- a/qcsrc/server/main.qh +++ b/qcsrc/server/main.qh @@ -44,6 +44,8 @@ float servertime, serverprevtime, serverframetime; .float contents_damagetime; +string GetField_fullspawndata(entity e, string f, ...); + /* ================== main