]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/items/all.qh
Merge branch 't0uYK8Ne/set_slick_friction' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / items / all.qh
index 809398bb292fa907c1e4f0d1a074ff646236bfee..3ff4a54155a3cccaf0ea91b69a38a02ac90c15dc 100644 (file)
@@ -1,19 +1,21 @@
-#ifndef ITEMS_ALL_H
-#define ITEMS_ALL_H
+#pragma once
 
-#include "../command/all.qh"
+#include <common/command/_mod.qh>
 
 #include "item.qh"
 
-REGISTRY(Items, BITS(5))
+// 24 so it matches the limit for the .items field
+REGISTRY(Items, 24)
 #define Items_from(i) _Items_from(i, NULL)
-REGISTER_REGISTRY(RegisterItems)
-/** If you register a new item, make sure to add it to all.inc */
-#define REGISTER_ITEM(id, class) REGISTER(RegisterItems, ITEM, Items, id, m_id, NEW(class))
+#ifdef GAMEQC
+REGISTRY_DEPENDS(Items, Models)
+#endif
+REGISTER_REGISTRY(Items)
+#define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
 
-REGISTRY_SORT(Items, 0)
+REGISTRY_SORT(Items)
 REGISTRY_CHECK(Items)
-STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); }
+STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
 
 void Dump_Items();
 
@@ -25,14 +27,12 @@ GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
         }
         default:
         case CMD_REQUEST_USAGE: {
-            LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+            LOG_INFOF("Usage:^3 %s dumpitems", GetProgramCommandPrefix());
             return;
         }
     }
 }
 
-#ifndef MENUQC
+#ifdef GAMEQC
 string Item_Model(string item_mdl);
 #endif
-
-#endif