]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
items: match SVQC .solid behaviour in CSQC
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 11 Jun 2023 17:53:44 +0000 (03:53 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 15 Jun 2023 20:36:25 +0000 (06:36 +1000)
qcsrc/client/items/items.qc

index 339e1428e1d8d1a69f41266e5f9298a5b0fb7fc6..2fa911d444ba9319b1e5f5a6bb726759f7310e07 100644 (file)
@@ -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();