]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/all.qh
Merge branch 'master' into terencehill/tooltips_cleanup
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
index 1786b4261131d020fa92996027dee78c44c25a8d..3f8c603e7ab2aabeb75c74f438a00e73bba7593b 100644 (file)
@@ -1,19 +1,20 @@
-#ifndef ALL_H
-#define ALL_H
+#ifndef ITEMS_ALL_H
+#define ITEMS_ALL_H
 
+void RegisterItems();
 const int MAX_ITEMS = 24;
-entity ITEMS[MAX_ITEMS];
-
-#define ITEMS_FOREACH(pred, body) do {      \
-    for (int i = 0; i < ITEM_COUNT; i++) {  \
-        const noref entity it = ITEMS[i];   \
-        if (pred) { body }                  \
-    }                                       \
-} while(0)
+entity ITEMS[MAX_ITEMS], ITEMS_first, ITEMS_last;
+int ITEM_COUNT;
+/** If you register a new item, make sure to add it to all.inc */
+#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, ITEMS, ITEM_COUNT, id, m_id, NEW(class))
+REGISTER_REGISTRY(RegisterItems)
 
-void RegisterItems();
 void Dump_Items();
 
+#ifndef MENUQC
+string Item_Model(string item_mdl);
+#endif
+
 #endif
 
 #include "inventory.qh"