-#ifndef LIB_STATS_H
-#define LIB_STATS_H
+#pragma once
// TODO: rename to 'netvars'
#include "sort.qh"
.int m_id;
-typedef vector vectori;
+USING(vectori, vector);
#define REGISTER_STAT(...) EVAL_REGISTER_STAT(OVERLOAD(REGISTER_STAT, __VA_ARGS__))
#define EVAL_REGISTER_STAT(...) __VA_ARGS__
#define REGISTER_STAT_3(id, T, expr) \
REGISTER_STAT_2(id, T); \
[[accumulate]] void GlobalStats_update(entity this) { STAT(id, this) = (expr); } \
- STATIC_INIT(worldstat_##id) { entity this = world; STAT(id, this) = (expr); }
+ STATIC_INIT(worldstat_##id) { entity this = NULL; STAT(id, this) = (expr); }
#else
#define REGISTER_STAT_2(id, type)
#define REGISTER_STAT_3(id, T, expr)
REGISTRY_CHECK(Stats)
STATIC_INIT(RegisterStats_renumber)
{
- FOREACH(Stats, true, LAMBDA(it.m_id = STATS_ENGINE_RESERVE + i));
+ FOREACH(Stats, true, it.m_id = STATS_ENGINE_RESERVE + i);
}
#ifdef SVQC
STATIC_INIT(stats_add) { stats_add(); }
#endif
-
-#endif