From 8454c78f3a414770aeffea73466bb57d763ea064 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Mon, 12 Jun 2023 03:53:44 +1000 Subject: [PATCH] items: match SVQC .solid behaviour in CSQC --- qcsrc/client/items/items.qc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/qcsrc/client/items/items.qc b/qcsrc/client/items/items.qc index 339e1428e..2fa911d44 100644 --- a/qcsrc/client/items/items.qc +++ b/qcsrc/client/items/items.qc @@ -249,11 +249,26 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) else this.effects &= ~EF_FULLBRIGHT; - if(this.ItemStatus & ITS_GLOW) + if(this.ItemStatus & ITS_AVAILABLE) { - if(this.ItemStatus & ITS_AVAILABLE) + if(this.solid != SOLID_TRIGGER) + { + this.solid = SOLID_TRIGGER; + setorigin(this, this.origin); // link it to the area grid + } + + if(this.ItemStatus & ITS_GLOW) this.effects |= (EF_ADDITIVE | EF_FULLBRIGHT); - else + } + else + { + if(this.solid != SOLID_NOT) + { + this.solid = SOLID_NOT; + setorigin(this, this.origin); // optimisation: unlink it from the area grid + } + + if(this.ItemStatus & ITS_GLOW) this.effects &= ~(EF_ADDITIVE | EF_FULLBRIGHT); } } @@ -262,7 +277,6 @@ NET_HANDLE(ENT_CLIENT_ITEM, bool isnew) { if (isnew) IL_PUSH(g_drawables, this); this.draw = ItemDraw; - this.solid = SOLID_TRIGGER; //this.flags |= FL_ITEM; this.fade_end = ReadShort(); -- 2.39.2