X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fall.qh;h=1e23f3287940218b3c8a882033d3f12b42c88fd2;hp=05eb4346db90d2cf958358410ec2d02e5546879a;hb=edf01df130d0d1877461561178b8833a9ab6051c;hpb=ae8867e3301e6cdda736e245858932f8f36d71f1 diff --git a/qcsrc/common/monsters/all.qh b/qcsrc/common/monsters/all.qh index 05eb4346d..1e23f3287 100644 --- a/qcsrc/common/monsters/all.qh +++ b/qcsrc/common/monsters/all.qh @@ -3,24 +3,20 @@ #include "monster.qh" -REGISTRY(Monsters, BIT(4)) -REGISTER_REGISTRY(RegisterMonsters) +string M_Model(string m_mdl); + +REGISTRY(Monsters, BITS(5)) +#define Monsters_from(i) _Monsters_from(i, MON_Null) +#define get_monsterinfo(i) Monsters_from(i) +REGISTER_REGISTRY(Monsters) +REGISTRY_CHECK(Monsters) const int MON_FIRST = 1; #define MON_LAST (Monsters_COUNT - 1) -/** If you register a new monster, make sure to add it to all.inc */ -#define REGISTER_MONSTER(id, inst) REGISTER(RegisterMonsters, MON, Monsters, id, monsterid, inst) +#define REGISTER_MONSTER(id, inst) REGISTER(Monsters, MON, id, monsterid, inst) REGISTER_MONSTER(Null, NEW(Monster)); -Monster get_monsterinfo(int id) -{ - if (id >= MON_FIRST && id <= MON_LAST) { - Monster m = Monsters[id]; - if (m) return m; - } - return MON_Null; -} -#include "all.inc" +#include "monster/_mod.inc" #endif