From 63c516442e96d778630596668e950913897d9fc8 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Mon, 3 Oct 2022 16:36:08 +1000 Subject: [PATCH] Add support for teamed items on Q3 maps by using fullspawndata Closes #2368 --- qcsrc/server/items/items.qc | 7 +++++++ qcsrc/server/main.qh | 2 ++ 2 files changed, 9 insertions(+) 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 -- 2.39.2