]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item.qh
Merge branch 'bones_was_here/sv_legacy_bbox_expand' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item.qh
index 8f651ad049bb19fd8d44591af923f9bbbc95357c..364baeebcac65f4d77c74bd768d225421a19fcf0 100644 (file)
@@ -24,16 +24,21 @@ const int IT_RESOURCE                               =  BIT(5); // bitflag to mark this item as a reso
 const int IT_KEY1                                              = BIT(6);
 const int IT_KEY2                                              = BIT(7);
 
+const int IT_BUFF                                              = BIT(8); // unused bit for buff items
+
 // special colorblend meaning in engine
-const int IT_INVISIBILITY                              = BIT(9);
-const int IT_INVINCIBLE                                = BIT(10);
+// legacy bitflags for powerups
+const int IT_INVISIBILITY                              = BIT(9);
+const int IT_INVINCIBLE                                        = BIT(10);
 const int IT_SUPERWEAPON                               = BIT(11); // suit
-const int IT_STRENGTH                                  = BIT(12);
+const int IT_STRENGTH                                  = BIT(12);
+const int IT_SPEED                                             = BIT(13);
 
 // item masks
 const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_UNLIMITED_SUPERWEAPONS | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
 
 // item networking
+const int ISF_SIZE2             = BIT(0);
 const int ISF_LOCATION          = BIT(1);
 const int ISF_MODEL             = BIT(2);
 const int ISF_STATUS            = BIT(3);
@@ -54,6 +59,14 @@ const int ITS_ALLOWFB           = BIT(4);
 const int ITS_ALLOWSI           = BIT(5);
 const int ITS_GLOW              = BIT(6);
 
+// item bboxes for sv_legacy_bbox_expand 0
+// Small, Default and Large (large maxs are used with default mins)
+const vector ITEM_S_MINS = '-16 -16 0'; // smaller items now get the same "unexpanded" bbox that normal items
+const vector ITEM_S_MAXS = '16 16 48';  // had during MoveOutOfSolid and DropToFloor (before expansion) in 0.8.5
+const vector ITEM_D_MINS = '-30 -30 0'; // 0.8.5 set '-16 -16 0' then DP subtracted '15 15 1' but NetRadiant used '-30 -30 0'
+const vector ITEM_D_MAXS = '30 30 48';  // 0.8.5 set '16 16 48' then DP added '15 15 1' but NetRadiant used '30 30 32'
+const vector ITEM_L_MAXS = '30 30 70';  // 0.8.5 set '16 16 80' for powerups, '16 16 70' for megas, '16 16 60' for buffs
+
 .float fade_start;
 .float fade_end;
 
@@ -65,27 +78,23 @@ const int ITS_GLOW              = BIT(6);
 .float invincible_finished; // ditto
 .float buffs_finished; // ditts
 
-#define spawnfunc_body(item) \
-       if (!Item_IsDefinitionAllowed(item)) \
+#define SPAWNFUNC_BODY(item) \
+       if (item && Item_IsDefinitionAllowed(item)) \
+               StartItem(this, item); \
+       else \
        { \
                startitem_failed = true; \
                delete(this); \
-               return; \
-       } \
-       StartItem(this, item)
+       }
 
 #define SPAWNFUNC_ITEM(name, item) \
        spawnfunc(name) \
        { \
-               spawnfunc_body(item); \
+               SPAWNFUNC_BODY(item) \
        }
 
 #define SPAWNFUNC_ITEM_COND(name, cond, item1, item2) \
-       spawnfunc(name) \
-       { \
-               entity item = (cond) ? item1 : item2; \
-               spawnfunc_body(item); \
-       }
+       SPAWNFUNC_ITEM(name, (cond ? item1 : item2))
 
 #else