]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item.qh
Fix #2069 "LMS doesn't remove 25h on some maps (forest2, farewell, probably others)"
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item.qh
index e59152076b754552eb266411710fdbab1e4efcbb..030b4db1c089f53f06c62a1cb19590ac48b50977 100644 (file)
@@ -51,16 +51,26 @@ const int IT_PICKUPMASK                     = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FU
 .float  strength_finished = _STAT(STRENGTH_FINISHED);
 .float  invincible_finished = _STAT(INVINCIBLE_FINISHED);
 
+#define spawnfunc_body(item) \
+       if (!Item_IsDefinitionAllowed(item)) \
+       { \
+               startitem_failed = true; \
+               delete(this); \
+               return; \
+       } \
+       StartItem(this, item)
+
 #define SPAWNFUNC_ITEM(name, item) \
-    spawnfunc(name) \
+       spawnfunc(name) \
+       { \
+               spawnfunc_body(item); \
+       }
+
+#define SPAWNFUNC_ITEM_COND(name, cond, item1, item2) \
+       spawnfunc(name) \
        { \
-               if (!Item_IsDefinitionAllowed(item)) \
-               { \
-                       startitem_failed = true; \
-                       delete(this); \
-                       return; \
-               } \
-               StartItem(this, item); \
+               entity item = (cond) ? item1 : item2; \
+               spawnfunc_body(item); \
        }
 
 #else
@@ -72,9 +82,8 @@ const int IT_PICKUPMASK                       = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FU
 enum
 {
        ITEM_FLAG_NORMAL = BIT(0), ///< Item is usable during normal gameplay.
-       ITEM_FLAG_INSTAGIB = BIT(1), ///< Item is usable in instagib.
-       ITEM_FLAG_OVERKILL = BIT(2), ///< Item is usable in overkill.
-       ITEM_FLAG_MUTATORBLOCKED = BIT(3)
+       ITEM_FLAG_MUTATORBLOCKED = BIT(1),
+       ITEM_FLAG_RESOURCE = BIT(2) ///< Item is is a resource, not a held item.
 };
 
 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)