]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/item.qh
Merge branch 'master' into TimePath/vehicles_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / item.qh
index 354bed2ba74ed2e24498a9f62c1a2d18c20a5ca6..0b17f35b2c1277fb60ebb687893da9bec20a4ff0 100644 (file)
@@ -2,25 +2,12 @@
 #define GAMEITEM_H
 #include "../oo.qh"
 #define ITEM_HANDLE(signal, ...) __Item_Send_##signal(__VA_ARGS__)
+/** If you register a new item, make sure to add it to all.inc */
 CLASS(GameItem, Object)
     ATTRIB(GameItem, m_id, int, 0)
-    METHOD(GameItem, show, void(entity this))
+    METHOD(GameItem, show, void(entity this));
     void GameItem_show(entity this) { print("A game item\n"); }
     void ITEM_HANDLE(Show, entity this) { this.show(this); }
 ENDCLASS(GameItem)
 
-
-int ITEM_COUNT;
-/** If you register a new item, make sure to add it to all.inc */
-#define REGISTER_ITEM(id, class, body)          \
-    entity ITEM_##id;                           \
-    void RegisterItems_##id() {                 \
-        const entity this = NEW(class);         \
-        ITEM_##id = this;                       \
-        this.m_id = ITEM_COUNT;                 \
-        ITEMS[ITEM_COUNT++] = this;             \
-        body                                    \
-    }                                           \
-    ACCUMULATE_FUNCTION(RegisterItems, RegisterItems_##id)
-
 #endif