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_init_##id(entity this) { body } \
void RegisterItems_##id() { \
- const entity this = NEW(class); \
+ entity this = NEW(class); \
ITEM_##id = this; \
this.m_id = ITEM_COUNT; \
ITEMS[ITEM_COUNT++] = this; \
- body \
+ RegisterItems_init_##id(this); \
} \
- ACCUMULATE_FUNCTION(RegisterItems, RegisterItems_##id)
-
+ ACCUMULATE_FUNCTION(RegisterItems, RegisterItems_##id) \
+ [[accumulate]] void RegisterItems_init_##id(entity this)
#endif