X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fcommon%2Fitems%2Fall.qh;h=623f71b3904ab7654d9e9e88e23291c45d84bb09;hb=101c811a51a08305d18ca504af57b5dab1bb16a4;hp=ca0189292ffa4b2dd4288b541541f988774c2ac0;hpb=b683bf23a495d3b1b3f6df3bda75bfe0f069ab05;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/items/all.qh b/qcsrc/common/items/all.qh index ca0189292..623f71b39 100644 --- a/qcsrc/common/items/all.qh +++ b/qcsrc/common/items/all.qh @@ -1,18 +1,20 @@ -#ifndef ITEMS_ALL_H -#define ITEMS_ALL_H +#pragma once -#include "../command/all.qh" +#include #include "item.qh" -REGISTRY(Items, BITS(5)) +REGISTRY(Items, BITS(7)) #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, m_name, 0) -STATIC_INIT(Items) { FOREACH(Items, true, LAMBDA(it.m_id = i)); } +REGISTRY_SORT(Items) +REGISTRY_CHECK(Items) +STATIC_INIT(Items) { FOREACH(Items, true, it.m_id = i); } void Dump_Items(); @@ -24,14 +26,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