-#ifndef ITEMS_ALL_H
-#define ITEMS_ALL_H
+#pragma once
-void RegisterItems();
-const int MAX_ITEMS = 24;
-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)
+#include <common/command/_mod.qh>
+
+#include "item.qh"
+
+REGISTRY(Items, BITS(5))
+#define Items_from(i) _Items_from(i, NULL)
+REGISTER_REGISTRY(Items)
+#define REGISTER_ITEM(id, class) REGISTER(Items, ITEM, id, m_id, NEW(class))
+
+REGISTRY_SORT(Items)
+REGISTRY_CHECK(Items)
+STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); }
void Dump_Items();
-#ifndef MENUQC
-string Item_Model(string item_mdl);
-#endif
+GENERIC_COMMAND(dumpitems, "Dump all items to the console") {
+ switch (request) {
+ case CMD_REQUEST_COMMAND: {
+ Dump_Items();
+ return;
+ }
+ default:
+ case CMD_REQUEST_USAGE: {
+ LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+ return;
+ }
+ }
+}
+#ifdef GAMEQC
+string Item_Model(string item_mdl);
#endif
-
-#include "inventory.qh"